@akinet/akidevrule 3.0.0

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +835 -0
  2. package/LICENSE +21 -0
  3. package/README.md +356 -0
  4. package/claude/CLAUDE.md +40 -0
  5. package/claude/agents/aki-challenger.md +38 -0
  6. package/claude/agents/aki-conduct.md +54 -0
  7. package/claude/agents/aki-hands.md +59 -0
  8. package/claude/agents/aki-judge.md +37 -0
  9. package/claude/agents/aki-maker.md +36 -0
  10. package/claude/fragments/settings.akidoc.fragment.json +15 -0
  11. package/claude/hooks/aki-update-check.mjs +160 -0
  12. package/claude/hooks/aki_version_check.mjs +83 -0
  13. package/docs/ref/macos-codesign-tcc.md +59 -0
  14. package/install.mjs +1067 -0
  15. package/install.ps1 +11 -0
  16. package/install.sh +12 -0
  17. package/package.json +52 -0
  18. package/payload/GEMINI.md +147 -0
  19. package/payload/METHOD-audit-flow.md +147 -0
  20. package/payload/METHOD-audit-subtraction.md +67 -0
  21. package/payload/METHOD-audit-zero-trust.md +49 -0
  22. package/payload/METHOD-deep-think.md +172 -0
  23. package/payload/METHOD-proportionality.md +62 -0
  24. package/payload/METHOD-ux-psych.md +60 -0
  25. package/payload/RULE-agent-behavior.md +138 -0
  26. package/payload/RULE-biz.md +51 -0
  27. package/payload/RULE-coding.md +130 -0
  28. package/payload/RULE-content-write.md +54 -0
  29. package/payload/RULE-db-design.md +26 -0
  30. package/payload/RULE-docs.md +144 -0
  31. package/payload/RULE-pattern-core.md +80 -0
  32. package/payload/RULE-release.md +215 -0
  33. package/payload/RULE-seo.md +173 -0
  34. package/payload/RULE-stack-akiNuxtCf.md +179 -0
  35. package/payload/RULE-stack-tauri.md +59 -0
  36. package/payload/RULE-ui-pattern.md +167 -0
  37. package/payload/index.md +91 -0
  38. package/skills/aki-article-writer/SKILL.md +50 -0
  39. package/skills/aki-article-writer/references/article-workflow.md +377 -0
  40. package/skills/akidevsync-notes/SKILL.md +48 -0
  41. package/skills/akidevsync-notes/scripts/notes_cli.py +212 -0
  42. package/skills/akiflow/SKILL.md +221 -0
  43. package/skills/akiflow/references/harness-facts.md +215 -0
  44. package/skills/akiflow/scripts/council-cost.sh +4 -0
  45. package/skills/akiflow/scripts/council-open.sh +4 -0
  46. package/skills/akiflow/scripts/council-read.sh +4 -0
  47. package/skills/akiflow/scripts/council-verify.sh +4 -0
  48. package/skills/akiflow/scripts/council_cost.py +149 -0
  49. package/skills/akiflow/scripts/council_open.py +323 -0
  50. package/skills/akiflow/scripts/council_read.py +148 -0
  51. package/skills/akiflow/scripts/council_verify.py +315 -0
  52. package/skills/akiflow/scripts/scythe.py +307 -0
  53. package/skills/akiflow/scripts/scythe.sh +4 -0
  54. package/skills/akigitcommit/SKILL.md +85 -0
  55. package/skills/akihelp/SKILL.md +47 -0
  56. package/skills/akihtmlreport/SKILL.md +59 -0
  57. package/skills/akilint/SKILL.md +29 -0
  58. package/skills/akirule/SKILL.md +155 -0
  59. package/skills/akiship/SKILL.md +55 -0
  60. package/skills/akithink/SKILL.md +59 -0
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: akigitcommit
3
+ description: Analyze the working tree and commit changes in clean logical groups. Triages a long half-finished tree first (finished vs mid-edit vs abandoned vs accidental) before grouping. Auto-detects CHANGELOG to switch between domain-grouped mode (3–5 commits by object/feature) and type-grouped mode (feat/fix/refactor). Stages by explicit path, never `git add -A`. Conventional Commits, no co-author trailers, never pushes unless asked.
4
+ ---
5
+
6
+ # akigitcommit — scientific grouped commits
7
+
8
+ Invoke with `/akigitcommit`. Goal: turn a messy working tree into a small set of clean, logically grouped commits — without ever losing staging from one group to the next.
9
+
10
+ ## Step 0 — triage a half-finished tree
11
+
12
+ **Run this only when the tree is not uniformly finished:** many changed files, a mix of committed and uncommitted work, edits visibly stopped mid-way, or the user asks to audit the tree before committing. A clean, coherent set of changes skips straight to mode detection.
13
+
14
+ Triage is an audit, so `RULE-agent-behavior.md` B5 applies in full — most importantly: **never run `git add`, `stash`, `checkout`, `restore`, `clean`, or `reset` during triage.** This is exactly the state in which uncommitted work is most valuable and least recoverable, and "tidying up" is the shape the loss usually takes.
15
+
16
+ Classify every chunk into one of four:
17
+
18
+ | Class | Signal | Disposition |
19
+ |---|---|---|
20
+ | **Finished** | a closed problem, coherent on its own | proceeds to grouping below |
21
+ | **Mid-edit** | intentional, the author is still on it | hold — do not commit inside someone's unfinished thought |
22
+ | **Abandoned** | an experiment that went nowhere | ask before anything; never discard on your own read |
23
+ | **Accidental** | debug prints, scratch files, temp output in the project tree (`RULE-agent-behavior.md` C5) | flag with the path; do not auto-delete |
24
+
25
+ **Mid-edit and abandoned cannot be told apart by reading the tree** — only the author knows which one a half-written function is. Present both as unclassified and ask; a guess here silently commits dead code or buries live work.
26
+
27
+ Output a short list (class, paths, one line each) and let the user confirm before grouping. If the leftovers will not be resolved in this session, they belong in a `docs/plan/` note, not `docs/research/` — a snapshot of today's tree is false tomorrow (`RULE-docs.md` C1).
28
+
29
+ ## Mode detection (run after triage)
30
+
31
+ Before grouping, check: does the repo have a `CHANGELOG.md`?
32
+
33
+ ```
34
+ ls CHANGELOG.md 2>/dev/null && head -60 CHANGELOG.md
35
+ ```
36
+
37
+ - **CHANGELOG present** → use **domain-grouped mode** (see below)
38
+ - **No CHANGELOG** → use **type-grouped mode** — a **fallback for repos outside the Aki ecosystem**. Every Aki project carries a `CHANGELOG.md` from creation (see `RULE-release.md`), so in an Aki repo a missing CHANGELOG is a defect to flag, not a mode to silently fall into.
39
+
40
+ ## Workflow (follow in order)
41
+
42
+ 1. **Read everything first.** Before staging anything, inspect the full picture:
43
+ - `git status --porcelain=v1` — every changed, staged, and untracked (`??`) path
44
+ - `git diff` — unstaged hunks
45
+ - `git diff --cached` — already-staged hunks
46
+ - For untracked files, look at the content so you can classify them correctly. Do not start staging until you understand the whole tree.
47
+
48
+ 2. **Group changes** using the mode detected above.
49
+
50
+ **Domain-grouped mode** (CHANGELOG present):
51
+ - Read the CHANGELOG to understand the scope of the current version/release.
52
+ - Group files by **object or domain** — all files that touch the same feature, subsystem, or concern go into one commit. Example: all files related to `log` (component, composable, i18n key, data file) → one commit.
53
+ - **The commit unit is one closed problem.** A problem's commit includes its code AND its `CHANGELOG.md` entry (and its `releases.json` entry when the change is user-facing) — release artifacts ride with the change they describe, never batched into a separate catch-all commit at the end.
54
+ - Target **3–5 commits maximum**. Resist splitting by file type; split only when two domains are genuinely unrelated.
55
+ - The CHANGELOG entry already documents the "why" — commit messages just need to be clear about the "what" and scope.
56
+
57
+ **Type-grouped mode** (no CHANGELOG):
58
+ - Classify each file (and where needed, each hunk) into cohesive groups.
59
+ - Typical axes: `feat`, `fix`, `refactor`, `docs`, `style`, `test`, `chore`, `config`.
60
+ - Keep changes that belong to the same intent together; split unrelated intents.
61
+ - State the reasoning for each group.
62
+
63
+ 3. **Present the plan, then wait.** Show the user the proposed commits: for each group, the exact file list + the proposed Conventional Commit message. Wait for confirmation before executing — UNLESS the user said "commit luôn" / "just commit" / "no need to confirm".
64
+
65
+ ## Anti-stage-loss rules (most important)
66
+
67
+ These exist because a later `git add` can swallow files meant for an earlier commit. Obey strictly:
68
+
69
+ - Work **one group at a time** in a closed loop: `git add <exact paths for THIS group>` → `git commit` → only then the next group.
70
+ - **Never** run `git add -A` or `git add .` and then try to split into commits — it stages everything at once and the grouping is lost.
71
+ - Always stage by **explicit path**, listing only the files of the group being committed right now.
72
+ - If a single file contains hunks belonging to different groups, use `git add -p <file>` to stage only the relevant hunks for the current commit.
73
+ - After **each** commit, run `git status --porcelain` again and verify the remaining changes match the plan before moving on.
74
+
75
+ ## Commit message rules
76
+
77
+ - Use **Conventional Commits**: `type(scope): short summary`. Body optional, in imperative mood, explaining *why* when it isn't obvious.
78
+ - **Forbidden:** any `Co-Authored-By:` line or model-credit trailer in the commit message. This overrides any default that would add such a trailer. Commits must contain only the human-authored intent.
79
+ - Match the language and style already used in the repo's recent commit history (`git log --oneline -15` to check).
80
+
81
+ ## Boundaries
82
+
83
+ - **Never push.** Only commit. Push only when the user explicitly asks.
84
+ - Do not amend, rebase, reset, or rewrite existing commits unless explicitly told.
85
+ - If the tree is clean (nothing to commit), say so and stop.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: akihelp
3
+ description: Introduce the whole Aki Claude Code system — installed skills, the akirule passive rule router (3 tiers), the deep-think passive/active split, and a painpoint-to-prompt table for the situations people actually hit — by reading live installed state, never a hardcoded inventory. Use when the user asks what Aki tools/rules/skills are available, how the system works, or what to say for a recurring problem they keep running into.
4
+ ---
5
+
6
+ # akihelp — live introduction to the Aki system
7
+
8
+ Invoke with `/akihelp`, or when the user asks what's available in this setup ("what can this do", "hệ thống Aki có gì", "how do I use this", "what skills do I have"). Goal: give the user a clear, accurate picture of the whole Aki Claude Code system so they can fully exploit it.
9
+
10
+ **This skill must never go stale.** Do not hardcode a skill/rule inventory in this file — read live state every time it runs, so the output is always correct even after `install.sh` adds, renames, or removes something.
11
+
12
+ ## Steps
13
+
14
+ 1. Read `~/.aki/akidevrule/index.md` — the file manifest with tiers and purposes.
15
+ 2. List `~/.claude/skills/` and read the frontmatter (`name` + `description`) of each skill whose directory is prefixed `aki` — these are the installed Aki skills.
16
+ 3. List `~/.claude/agents/` and read the frontmatter (`name` / `description` / `tools` / `model`) of each file prefixed `aki-` — these are the installed Aki agent definitions. The directory is shared with the user's own agents, so introduce only the `aki-` ones. If the directory does not exist, that layer is simply not installed: drop the section rather than describing it.
17
+ 4. Render a compact overview with these sections:
18
+
19
+ - **Skills (active, user-invoked)** — one row per aki-skill: its `/name`, its one-line description (from frontmatter), and when to reach for it.
20
+ - **Agent definitions (who the work gets handed to)** — one row per installed `aki-` agent from step 3: what it is for, and the property that is mechanical rather than promised (its `tools:` list, which is what makes a read-only agent actually read-only, and its `model:`, so a tier is never improvised). Say the thing people get wrong: this is a catalog, not a roster — an agent is spawned because a specific requirement needs it, never because it exists.
21
+ - **Passive system (akirule)** — explain the 3 tiers: Core rules always loaded every turn; Contextual/Analytical rules auto-loaded on signal match; full load via an explicit phrase ("nạp full", "load all rules"). Note that `akirule` itself is hidden from the `/` menu by design (`user-invocable: false`) — it runs passively, not as a command.
22
+ - **One brain, two modes** — `METHOD-deep-think.md` is read passively by akirule inside normal tasks (brief, inline, at most one clarifying question) and actively by `/akithink` (full 5-phase interactive session for big/hard-to-reverse/goal-ambiguous decisions). Short version of the comparison, not the full METHOD text.
23
+ - **Editing rules** — this whole system is generated from a source repo (akidevrule); the installed copies under `~/.aki/akidevrule` and `~/.claude` are deployed output, never edited directly. Changes go through the source repo + `install.sh`. Note for context: the same skill corpus (not the rule corpus) is also synced by `install.sh` to Antigravity/Gemini and to Codex, Kiro, and Grok CLIs on this machine if present — this skill itself only introduces the Claude Code side.
24
+
25
+ 5. Render a **painpoint → what to say** table. This is the section most people actually need: a capability list tells them what exists, this tells them which words to type when a specific problem is in front of them. Build every row from what steps 1–3 actually returned, and **drop any row whose skill or rule file did not appear there** — a row pointing at something uninstalled is worse than a missing row.
26
+
27
+ | The situation they are actually in | What to say | What it reaches |
28
+ |---|---|---|
29
+ | Styles are sprawling — duplicated classes, hardcoded colors, CSS piling up in component `<style>` blocks | *"Audit CSS this repo per `ui.C`. Read-only, produce a plan."* then a separate *"Clean per the plan, one pattern per pass."* | `RULE-ui-pattern.md` §C — the inversion check runs first and decides whether the rest is even worth doing |
30
+ | Docs describe something the code no longer does | *"Drift audit the docs against the code."* | `RULE-docs.md` §C — severity split across wrong / stale / incomplete / cosmetic |
31
+ | Long half-finished working tree, unclear what is safe to commit | `/akigitcommit` | Triages finished vs mid-edit vs abandoned vs accidental **before** grouping; stages by explicit path, never `git add -A` |
32
+ | Work is finished but not pushed, and they want to know if it is genuinely shippable | *"Is this ready to ship?"* / *"xong chưa"* | `RULE-release.md` B7 pre-ship gate — a pass/fail check, not a document |
33
+ | A decision is big, hard to reverse, or the real goal is still fuzzy | `/akithink` | Full 5-phase session: restate → goal excavation → first principles → mandatory critique → decision record. Small reversible calls should just be decided instead |
34
+ | Replies are padded, or lines are hard-wrapped mid-sentence | Name the penalty card: *"`[FLUFF]`"* / *"`[WRAP]`"* / *"`[YAP]`"*, or run `/akilint` | `RULE-agent-behavior.md` §0. `/akilint` runs the deterministic detector for the two mechanical cards; `[FLUFF]` stays human judgment and no script claims it |
35
+ | One task genuinely needs several kinds of judgment at once (architecture *and* UX *and* market) | `/akiflow` | Lead-coordinated council with `aki-challenger`'s subtraction pass ("what can be cut?") and a mechanical closure gate. Overkill for ordinary work — say so plainly rather than routing everything here |
36
+ | Work is large and parallel but the answer is already knowable — a sweep, a migration, a fan-out across many files | `/akiflow`, as a **dispatch** rather than a council | Same anchor, rule receipts, durable record and closure gate; lanes with an exclusive `writes:` file set replace items with adversaries, and `--convene` refuses two lanes claiming one path. Wanting a challenger mid-run means it was a council question after all |
37
+ | The same guard, check, or fallback keeps reappearing around one path | *"Why does this flow need so many guards?"* | `METHOD-audit-flow.md` + `pattern.A8` — reshape the flow instead of stacking another guard on it |
38
+ | A guard, limit, or quota is being added against abuse nobody has measured — or a client-side check is about to be treated as enforcement | *"How many people can actually reach this, and what does that earn in protection?"* | `METHOD-proportionality.md` — reach, capability, motive, blast radius before the verdict; irreversible damage outranks low frequency, and anything the browser computes the browser can change |
39
+ | The repo has accumulated, and the ask is to cut it back as far as it can go | *"Subtraction audit this repo — read-only, report plus a plan."* | `METHOD-audit-subtraction.md` — "as minimal as possible" is not a stopping rule, so it terminates on two consecutive rounds with no new findings, with Chesterton's Fence before any certain removal |
40
+ | The interface works but feels confusing or people do not complete the flow | *"Review the UX of this screen."* | `METHOD-ux-psych.md` — a behavioral lens, distinct from `RULE-ui-pattern.md` which owns visual structure |
41
+ | A pricing, positioning, or audience call | *"Who is this for and what should it cost?"* | `RULE-biz.md` — plus `docs/biz/` as the project's source of truth |
42
+ | An analysis in chat is too dense to read as text | `/akihtmlreport` | Renders the analysis already in the conversation as one self-contained HTML file — it visualizes, it does not re-analyze |
43
+ | Unsure whether a rule loaded at all | *"nạp full"*, or just read the `[RULES]` line | Every response carries a `[RULES]` receipt naming the whole rule context and a `missing:` field, so "the rule never arrived" is visibly different from "the rule arrived and was ignored" — the two have opposite fixes. `nạp full` is the Tier 2 escape hatch that reads everything |
44
+
45
+ 6. Close with the one caveat that changes how people use all of the above: **`akirule` is a skill, so it is best-effort** — it applies only when the model chooses to invoke it and a signal matches. Only `index.md`, `RULE-agent-behavior.md`, `RULE-coding.md` and `RULE-pattern-core.md` are guaranteed, because the harness `@`-imports them through `CLAUDE.md`. When something must be deterministic, name the file in the prompt (*"Read `~/.aki/akidevrule/RULE-ui-pattern.md`, then …"*) instead of trusting the signal to fire.
46
+
47
+ 7. Keep the output scannable: compact tables or short bulleted sections, not an essay. Respond in the user's language, and translate the example prompts into that language rather than pasting them verbatim in English.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: akihtmlreport
3
+ description: Visualize a complex report that already exists in the conversation as one self-contained HTML file — nothing else, no new analysis. Distills a dense analysis/report already discussed into a single-file, ultra-wide, visually dense HTML report (REPORT.html) at the project root, for content too dense to stay legible as chat text.
4
+ ---
5
+
6
+ # akihtmlreport — single-file visual report extraction
7
+
8
+ Invoke with `/akihtmlreport`, or when the user asks in their own words to extract the discussion into a visual file ("trích xuất ra html", "xuất báo cáo trực quan", "làm file report", "export this to html"). Its purpose is single and narrow: turn a complex analysis or report that already exists in this conversation into one self-contained HTML file for dense, at-a-glance reading — **nothing else, no new analysis**. Not a replacement for chat responses, and not something to reach for by default.
9
+
10
+ ## When this skill actually applies
11
+
12
+ This is for content that has already gotten too dense to stay legible as chat text: a multi-part investigation report, a root-cause writeup with several code/log excerpts, a checklist spanning many items each with its own status, a comparison across several options, a Mac/manual test plan with many steps and expected results. The content must already exist in the conversation — this skill distills and formats, it does not originate new analysis.
13
+
14
+ **Do not use this skill for:**
15
+ - a short answer, a single fix explanation, or anything that already reads fine as chat text
16
+ - routine status updates or one-off command output
17
+ - anything the user hasn't actually asked to have extracted — only trigger on an explicit request, never proactively just because a response got long
18
+
19
+ If invoked on content that turns out not to be dense/complex enough to justify a visual file, say so and ask whether the user still wants one, instead of silently producing a thin HTML wrapper around a two-line answer.
20
+
21
+ ## Target file — default path and the single-file rule
22
+
23
+ - Default output: **project root**, filename **`REPORT.html`** (uppercase, no variant names, no topic/version suffix).
24
+ - **Exactly one `REPORT.html` exists per project at a time.** This is deliberate: the point is to keep attention on ONE complex task at a time, not to accumulate a pile of past reports. Never create `REPORT-2.html`, `REPORT-v2.html`, `REPORT-<topic>.html`, and never move a prior one aside automatically to make room for a new one.
25
+ - **Before writing, handle any existing `REPORT.html` cheaply — never `Read` it.** A finished `REPORT.html` is large, dense HTML; reading it back burns tokens for nothing, since this skill always regenerates the file wholesale and never edits it in place. Inspect only its metadata with a shell one-liner (`ls -la REPORT.html`, or `find REPORT.html -mmin +720` — 720 min = 12 h):
26
+ - Does not exist → write directly.
27
+ - Exists but stale (last modified more than ~12 h ago) → a leftover from an unrelated past task. Delete it (`rm REPORT.html`) and write fresh — no read, no prompt. Deleting first also clears the read-before-write step, since the file no longer pre-exists. State in one line which stale file you removed.
28
+ - Exists and recent (≤ ~12 h) → probably tied to the current or a closely related task. Still do not read it; stop and ask the user (overwrite, or skip). On overwrite, `rm` it first, then write. Never auto-rename to dodge the collision — that defeats the single-file rule.
29
+ - If the user explicitly names a different path or filename in their request, honor that instead — the default only applies when they haven't specified one.
30
+ - **Git-ignore it.** `REPORT.html` is a disposable visual export, not a doc source of truth (that's `docs/arch`/`docs/plan`) — it gets fully overwritten every time this skill runs, so tracking it in git only produces noise diffs unrelated to real code changes. If the target project is a git repo and its `.gitignore` doesn't already exclude `REPORT.html`, add an entry for it (with a one-line comment explaining why) the first time this skill writes the file there.
31
+
32
+ ## Layout requirements — ultra-wide, narrow (dense)
33
+
34
+ - **Ultra-wide**: use the full viewport width, no centered narrow reading column. Use CSS grid/flex for multi-column layout wherever the content has parallel structure (comparison tables, side-by-side before/after, a checklist next to its rationale).
35
+ - **Narrow means dense, not cramped**: small, disciplined padding/margins and a compact type scale — mirrors Aki's "Extreme Narrow" UI philosophy. Every section should show as much signal as possible without unnecessary scrolling. No hero banners, no decorative whitespace, no filler — this is a working document, not a landing page.
36
+ - **Single file**: all CSS and JS inline in one `<head>`/`<body>`, zero external requests (fonts, CDNs, images, analytics) — must render correctly opened straight from disk via `file://`, no network required.
37
+ - **Theme-aware**: support both light and dark via `prefers-color-scheme` — the user may open this in any browser/OS setting, not necessarily a dark-themed one.
38
+ - Wide tables and code/log blocks get their own `overflow-x: auto` container — never let them force the page itself to scroll horizontally.
39
+ - Use real semantic structure — `<table>`, `<details>`, headers, color-coded status chips/badges for states like done/pending/confirmed/open/blocked or severity levels. The goal is scanability, not a prose wall reformatted with a few `<h2>` tags.
40
+
41
+ ## Content — distill, don't just reformat
42
+
43
+ - **Header** (top of `<body>`): the report title, one line on what it is, and a generation timestamp. Compute the timestamp in **UTC** at write time — run `date -u +%Y-%m-%dT%H:%M:%SZ` in the shell and embed that exact ISO string in a `data-utc` attribute — then render it in the **viewer's local time**, down to hour:minute:second and with the zone, via a tiny inline script (e.g. `el.textContent = new Date(el.dataset.utc).toLocaleString()`). Never hard-code a local time: the file may be opened on a machine in a different timezone than where it was generated.
44
+ - **Table of contents** (directly under the header): a compact TOC listing every section as anchor links. Give each section a stable `id` (`<section id="findings">…</section>`) so the links jump to it. Keep it small and dense — a single row of links or a narrow box, never a full-height sidebar.
45
+ - Sections matching the natural structure of the analysis already discussed — one section per investigation area, one table per checklist, one card per open question/decision point. Each section carries the `id` that its TOC entry targets.
46
+ - Status/severity color-coding wherever the content has state — this is the main value-add over plain chat text, so don't skip it even under time pressure.
47
+ - **Evaluation reports only** — when the source is a *discussion or assessment* (a refactor, a code review, a strategy, or an idea — the Module 5 cases), surface each item's **side effects** and **edge cases** as a first-class element (its own column, chip, or card), never buried in prose, and separate what can be decided autonomously from what needs the user's call. Keep the MVP / main recommendation the headline and let SFX/EC support it — but if one is a blocker (severe enough to change the recommendation), flag it prominently as such, not as a footnote. Do NOT add this scaffolding to reports that aren't evaluations (status, investigation, test plans) — that would be over-fitting.
48
+ - Code/log excerpts go in `<pre>`/`<code>` blocks with their own scroll container, never inlined into prose paragraphs.
49
+ - **Preserve every concrete fact, file path, line reference, and command from the original discussion** — this is an extraction, not a re-summary. Do not drop detail to make it shorter; the whole point of a wide/dense layout is that it can hold more, not less.
50
+ - **A final summary is mandatory**: the closing takeaway section is always a short, plain-language bottom line — the decision, the outcome, or the single thing to remember — even when the body is exhaustive. It comes last, or immediately above the glossary appendix when one is present. Give it an `id` and a TOC entry like any other section.
51
+ - **Glossary / notes appendix (when needed)**: if the report leans on abbreviations, shortened forms, special jargon that could be misread, or even basic terms used without inline explanation, add a compact term → meaning table as the very last section, after the summary. Include it only when there is genuinely something to clarify — skip it entirely otherwise, and do not repeat terms already explained inline. Give it an `id` and a TOC entry.
52
+
53
+ ## Pairs naturally with `/akithink`
54
+
55
+ A `/akithink` Phase 5 convergence (decision + rationale + rejected alternatives + assumptions to monitor) is a common source of exactly the kind of dense, multi-part material this skill exists to visualize — the docs file stays the source of truth, `/akihtmlreport` just gives it a scannable view.
56
+
57
+ ## After writing
58
+
59
+ After writing the file, open it locally: `open REPORT.html` on macOS, falling back to `xdg-open` on Linux. If opening fails (headless environment, no `xdg-open`, etc.), just tell the user the file's path instead of failing the skill. Never publish or host it anywhere — if the user separately asks for a hosted, shareable version, that is a different request (the `Artifact` tool), not part of this skill.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: akilint
3
+ description: Mechanical format lint for the penalty-card classes of RULE-agent-behavior.md §0 — hard-wrapped code comments and markdown prose ([WRAP]) and oversize comments ([YAP]) — via the shared scythe.py detector. Deterministic file:line output; judgment stays with the session. Use when the user asks to lint/quét formatting, mentions wrapline, "bẻ dòng", "comment lảm nhảm", or calls a penalty card ([WRAP]/[YAP]/[FLUFF]) on recent output.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # akilint — penalty-card lint
8
+
9
+ Runs the shared detector — never a model sweep for what a grep settles:
10
+
11
+ ```bash
12
+ python3 ~/.claude/skills/akiflow/scripts/scythe.py <file|dir> [...] # on other CLIs: the same path under that CLI's skills root
13
+ ```
14
+
15
+ The script is the SSoT for these detectors — akiflow's `aki-conduct` seat runs the same one, so a card name means the same thing everywhere. Exit code: 0 clean, 1 findings — usable from CI or hooks without parsing.
16
+
17
+ ## Scope — what the script can and cannot claim
18
+
19
+ - `[WRAP]` — a logical line split across physical lines: a 2-line comment whose second line reads as a lowercase continuation, or a markdown prose line broken mid-sentence. Root rule: `agent.C3`.
20
+ - `[YAP]` — a comment block ≥3 lines, or a comment line >200 chars. Always labeled **(review)**: a flag for judgment against `coding.B4`, never an auto-delete verdict — a legitimate long WHY exists and `agent.C3` forbids wrapping it, so length alone convicts nothing.
21
+ - `[FLUFF]` (density, `agent.A4`) is content understanding — a script cannot check it and this skill never claims it.
22
+
23
+ ## Protocol
24
+
25
+ 1. Run scythe on the paths in scope. Default scope = the files this session touched or the paths the user named; a repo-wide sweep is proposed in one line first, not assumed (`agent.B1`).
26
+ 2. Report the findings verbatim — they are already dense coordinates; do not re-narrate them.
27
+ 3. Fix `[WRAP]` findings directly: rejoining is mechanical (`agent.C3`) — but honor C3's atomic-line cautions: never merge frontmatter fields, one-per-line directives, or any line something parses.
28
+ 4. Judge each `[YAP]` finding against `coding.B4` before touching it: fix the name/shape first, delete second, keep a genuine WHY (or move an oversize rationale to a doc and leave the reference, `docs.B3`). State in one line what was kept and why.
29
+ 5. False positives (a legitimate docblock, a keyword list): name them as such in the report — do not silently skip, and do not "fix" them.
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: akirule
3
+ description: Aki's contextual rule router — invoke BEFORE acting whenever the task touches any of - .md/.vue/.css/.tsx/.rs/.sql files; docs, plan, README, CHANGELOG; UI, component, CSS, tailwind; SEO, schema, sitemap; release, version, commit, push, deploy; DB schema, migration; Tauri; i18n, UI copy; pricing, biz; UX review; refactor, flow tracing; audit or minimize sweeps; big decisions (should we / có nên). Full corpus load on "nạp full". Core rules are not routed here — the harness embeds them via CLAUDE.md.
4
+ user-invocable: false
5
+ ---
6
+
7
+ ## What this skill does and does not guarantee
8
+
9
+ **Nothing in this file is guaranteed to run.** A skill loads only when the model chooses to invoke it, so every rule routed below is best-effort.
10
+
11
+ The rules that must apply unconditionally are not here. `index.md`, `RULE-agent-behavior.md`, `RULE-coding.md` and `RULE-pattern-core.md` are embedded by the harness through `@` imports in `~/.claude/CLAUDE.md`, which is read mechanically at session start. Do not move them back into this file: an `@` path inside a skill body is not expanded by the harness the way it is inside `CLAUDE.md`, so declaring them here would look like an import while loading nothing.
12
+
13
+ The last two used to be routed here as "default ON" Tier 1 entries. That phrasing promised a guarantee the mechanism could not deliver — a file routed by a skill loads only if the model first decides to invoke the skill — and the observed failure was not the rules being read and ignored but never being read at all. Do not re-add them below: they are already in context on every turn, so a signal block for them would only produce a redundant `Read`.
14
+
15
+ ## Addressing scheme (recall only — does not affect routing)
16
+
17
+ Every rule file is internally organized into groups `A`/`B`/`C` and numbered items `1`/`2`/`3…` (e.g. `coding.B2`, `stack.C1`). `topic` = the manifest's Topic column in `index.md` — usually the filename minus its `RULE-`/`METHOD-` prefix; the audit methods keep their short topics (`flow`, `zero-trust`, `subtract`). This is a naming convention for referring to a specific rule precisely — it has no effect on which files load or when; that is still governed entirely by the tiers below. Full map: `~/.aki/akidevrule/index.md`.
18
+
19
+ ---
20
+
21
+ ## Tier 1 — Contextual loading
22
+
23
+ **Sensitivity bias: when in doubt, load. A false positive (loading an unused file) costs a few tokens. A false negative (missing a rule) causes wrong behavior.**
24
+
25
+ Before responding, scan the user message and any file paths mentioned. For each rule below: if ANY single signal matches → Read that file immediately, before generating a response.
26
+
27
+ Skip the Read if that file was already loaded earlier in this conversation — a signal match on an already-loaded rule costs a redundant Read and changes nothing.
28
+
29
+ **A file extension alone is a sufficient signal.** Touching a `.md` loads `RULE-docs.md`; a `.vue`/`.css` loads `RULE-ui-pattern.md`; `.rs`/`Cargo.toml` loads `RULE-stack-tauri.md`; `.sql`/`migrations/` loads `RULE-db-design.md`. The project does **not** need a matching folder structure, a `docs/` tree, or an existing design system first — match on what is being touched, not on how mature the project is. The keyword and action lists below are additional entry points, never a required second condition.
30
+
31
+ ### RULE-coding.md · RULE-pattern-core.md — not routed, already loaded
32
+ Both are core `@` imports (see the section above) and are in context on every turn without this skill running. Nothing to match, nothing to `Read`, and they never appear in a load-confirmation line.
33
+
34
+ ### RULE-docs.md
35
+ Load if message or file path contains any of:
36
+ - **Keywords:** `docs`, `CLAUDE.md`, `README`, `PLAN`, `plan/`, `diagram`, `mermaid`, `architecture`, `arch/`, `doc sync`, `documentation`, `docs/feat/`, `plan lifecycle`, `tài liệu`, `sơ đồ`, `kiến trúc`
37
+ - **Keywords (drift audit):** `drift`, `audit docs`, `stale docs`, `outdated docs`, `out of date`, `docs khớp code`, `còn khớp`, `lệch`, `lỗi thời`, `rà soát tài liệu`, `docs cũ`, `kiểm tra tài liệu`
38
+ - **Paths:** **any `.md` file, anywhere** — writing or editing Markdown *is* a docs task; do not wait for a `docs/` folder to exist. Also `docs/**`, `PLAN.md`, `CLAUDE.md`, `README.md`, `CHANGELOG.md`, `*.mdx`, `SKILL.md`
39
+ - **Actions:** creating, editing, moving, or completing any plan or doc file; checking whether docs still match the code after the fact (`docs.C`)
40
+
41
+ ### RULE-content-write.md
42
+ Load if message or file path contains any of:
43
+ - **Keywords:** `button`, `label`, `heading`, `error message`, `tooltip`, `empty state`, `i18n`, `locale`, `translation`, `t(`, `$t(`, `meta title`, `meta description`, `og:`, `JSON-LD`, `FAQ`, `landing page`, `UI text`, `nội dung UI`, `nội dung giao diện`, `nhãn`, `thông báo lỗi`, `semantic stability`
44
+ - **Paths:** `locales/**`, `i18n/**`, `*.i18n.*`, `public/content/**`; any file where a string a user will read is being added or renamed
45
+ - **Actions:** renaming a concept or term used across the product
46
+
47
+ ### RULE-stack-akiNuxtCf.md
48
+ **Default ON when the project CLAUDE.md references the Aki web stack (Nuxt/Cloudflare — AkiNuxtCf).** Skip only when the task is provably stack-independent (plain markdown, isolated script, config unrelated to the Aki frontend stack). Load if message or file path contains any of:
49
+ - **Keywords:** `nuxt`, `vue`, `cloudflare`, `cloudflare workers`, `cf workers`, `wrangler`, `tailwind`, `composable`, `middleware`, `nuxt layout`, `nuxt plugin`, `component`, `useRoute`, `useFetch`, `definePageMeta`, `nitro`, `vite`, `breadcrumb`, `scroll-to-top`, `back-to-home`, `layout chrome`, `useBreadcrumb`
50
+ - **Paths:** `components/**`, `pages/**`, `composables/**`, `layouts/**`, `plugins/**`, `middleware/**`, `wrangler.toml`, `nuxt.config.*`, `tailwind.config.*`, `app.vue`
51
+
52
+ ### RULE-ui-pattern.md
53
+ Load if message or file path contains any of:
54
+ - **Keywords (enforcement):** `component`, `vue`, `nuxt`, `tailwind`, `css`, `class`, `style`, `design token`, `token`, `variant`, `design system`, `atomic design`, `pattern class`, `@apply`, `@layer`, `BaseButton`, `c-btn`, `c-card`
55
+ - **Keywords (audit):** `dọn dẹp`, `class trùng`, `duplicate class`, `duplicate CSS`, `trùng lặp`, `audit CSS`, `refactor CSS`, `refactor UI`, `arbitrary value`, `quét class`, `w-[`, `text-[`
56
+ - **Keywords (minimization):** `tối giản`, `giảm CSS`, `bớt CSS`, `minimize CSS`, `reduce CSS`, `gọn lại`, `CSS rác`, `style block`, `inline style`, `scoped style`, `@theme`, `theme block`, `token drift`, `nhiều CSS quá`, `code CSS nhiều`
57
+ - **Paths:** any `.vue`, `.css`, `.scss`, or `.tsx`; `components/**`, `assets/css/**`, `tailwind.config.*`
58
+ - **Actions:** writing/refactoring any component or style; auditing a frontend codebase for DRY/SOLID violations
59
+
60
+ ### RULE-seo.md
61
+ Load if message or file path contains any of:
62
+ - **Keywords:** `seo`, `schema`, `sitemap`, `robots`, `canonical`, `usePageSeo`, `useSchemaOrg`, `JSON-LD`, `structured data`, `og:`, `ogImage`, `hreflang`, `alternateName`, `sameAs`, `knowsAbout`, `LLM visibility`, `AI visibility`, `AI Overview`, `entity`, `schema.org`, `DefinedTerm`, `validate-seo`, `meta title`, `meta description`, `OG image`, `trailing slash`
63
+ - **Paths:** `docs/seo/**`, `docs/ref/seo*`, `scripts/validate-seo*`, `composables/usePageSeo*`, `composables/useSeoSchemas*`
64
+ - **Actions:** creating a new page, adding schema, configuring sitemap or robots
65
+
66
+ ### RULE-release.md
67
+ Load if message or file path contains any of:
68
+ - **Keywords:** `release`, `release note`, `release notes`, `changelog`, `CHANGELOG`, `version`, `versioning`, `semver`, `bump`, `bump version`, `major.minor.patch`, `releases.json`, `phát hành`, `phiên bản`, `cập nhật phiên bản`, `nâng version`
69
+ - **Paths:** `CHANGELOG.md`, `app/data/releases.json`, `pages/releases/**`
70
+ - **Keywords (pre-ship gate):** `chưa push`, `trước khi push`, `trước khi deploy`, `sắp release`, `chuẩn bị ship`, `pre-release`, `ready to ship`, `xong chưa`, `đã xong hết chưa`
71
+ - **Keywords (release-ritual context — these load this rule file, they never start a run; execution needs a literal `/akiship` per that skill's activation gate):** `akiship`, `full release`, `release trọn gói`, `chạy full release`, `ship đợt này`, `ship trọn gói`
72
+ - **Keywords (commit/push/deploy — load even without an explicit "release" word):** `commit`, `git commit`, `push`, `git push`, `deploy`, `deployment`, `git tag`, `ship it`, `commit và push`, `push lên`, `đẩy lên`, `triển khai`
73
+ - **Keywords (registry publish — `release.B9`):** `npm publish`, `publish`, `npm`, `npx`, `registry`, `crates.io`, `cargo publish`, `PyPI`, `twine`, `2FA`, `OTP`, `lên npm`
74
+ - **Actions:** committing or pushing code, deploying, shipping a change that should be recorded for users or maintainers; bumping a version; checking whether finished-but-unpushed work is actually shippable (`release.B7`); running the full release ritual unattended (`release.B8`, `/akiship`)
75
+
76
+ ### RULE-stack-tauri.md
77
+ **Default ON for any Tauri project context.** Skip only when the task is provably unrelated to the Tauri/Rust backend (pure frontend copy change with no `src-tauri` involvement, isolated doc edit). Load if message or file path contains any of:
78
+ - **Keywords:** `tauri`, `#[tauri::command]`, `invoke(`, `spawn_blocking`, `async_runtime`, `Cargo.toml`, `tauri.conf.json`, `capabilities`, `IPC`, `blocking UI`, `freeze`, `treo app`, `đứng app`, `block UI`
79
+ - **Paths:** any `.rs`; `src-tauri/**`, `tauri.conf.json`, `Cargo.toml`, `capabilities/*.json`
80
+ - **Actions:** adding/editing any `#[tauri::command]`, touching window/IPC code, bumping app version, diagnosing an app freeze/hang
81
+
82
+ ### RULE-db-design.md
83
+ Load if message or file path contains any of:
84
+ - **Keywords:** `schema`, `migration`, `D1`, `SQL`, `database design`, `ERD`, `refactor DB`, `event sourcing`, `bounded context`, `normalization`, `1NF`, `table design`, `thiết kế db`, `thiết kế database`, `migration DB`
85
+ - **Paths:** any `.sql`; `migrations/**`, `schema.sql`, `**/d1/**`
86
+ - **Actions:** designing a new table/schema, writing a DB migration, refactoring how data is stored
87
+
88
+ ### METHOD-audit-flow.md
89
+ Load if message contains any of:
90
+ - **Keywords:** `refactor`, `restructure`, `simplify`, `fragile`, `complicated`, `state machine`, `async chain`, `tại sao phức tạp`, `luồng`, `luồng xử lý`, `tracing`, `cause and effect`, `over-guarded`, `nested conditional`, `điều kiện lồng nhau`, `timing issue`, `race condition`, `tái cấu trúc`, `đơn giản hóa`
91
+ - **Context:** fixing a bug spanning multiple files, tracing cause and effect across a chain
92
+
93
+ ### RULE-biz.md
94
+ Load if message or file path contains any of:
95
+ - **Keywords:** `pricing`, `price`, `monetization`, `monetize`, `positioning`, `USP`, `target audience`, `customer`, `market`, `marketing`, `conversion`, `landing page`, `business model`, `revenue`, `tier`, `plan`, `subscription`, `giá`, `định giá`, `kiếm tiền`, `khách hàng`, `thị trường`, `đối tượng`, `chuyển đổi`, `mô hình kinh doanh`, `doanh thu`, `gói`, `định vị`
96
+ - **Paths:** `docs/biz/**`
97
+ - **Context:** any market-facing decision — evaluating an idea's commercial shape, writing/reviewing landing or sales copy, creating or editing `docs/biz/`, deciding what to charge or who the product is for
98
+
99
+ ### METHOD-ux-psych.md
100
+ Load if message contains any of:
101
+ - **Keywords:** `UX`, `user experience`, `usability`, `user behavior`, `user psychology`, `onboarding`, `user flow`, `friction`, `cognitive load`, `empty state`, `first run`, `dead end`, `dark pattern`, `trải nghiệm người dùng`, `tâm lý người dùng`, `hành vi người dùng`, `khó dùng`, `rối`, `luồng người dùng`, `đánh giá giao diện`, `review UI`, `review UX`
102
+ - **Context:** evaluating an interface or flow through user behavior (not just visual styling — that is `RULE-ui-pattern.md`), designing an onboarding/conversion flow, diagnosing "why don't users do X"
103
+
104
+ ### METHOD-audit-zero-trust.md
105
+ Load if message contains any of:
106
+ - **Keywords:** `audit khắt khe`, `ép rule`, `force audit`, `quét tuyệt đối`, `zero-trust audit`, `rà soát toàn bộ`, `quét toàn dự án`, `chứng minh sạch`, `audit tuyệt đối`
107
+ - **Context:** when the user asks for an uncompromising sweep — of the whole project or of a change plus everything that reads it — that must be driven by detectors rather than by impression. Read-only: it produces a short findings report, not fixes.
108
+
109
+ ### METHOD-deep-think.md
110
+ Load if message contains any of:
111
+ - **Keywords:** `new feature`, `tính năng mới`, `should we`, `có nên`, `simplest way`, `đơn giản nhất`, `is this worth`, `có đáng`, `tradeoff`, `scope creep`, `mở rộng scope`, `premature`, `complexity`, `abstraction`, `tooling`, `first principles`, `tư duy nguyên bản`, `phản biện`, `mục tiêu tối thượng`, `one-way door`, `quyết định lớn`, `decision record`, `pre-mortem`, `evaluate`, `assess`, `review the approach`, `worth refactoring`, `good idea`, `side effect`, `edge case`, `đánh giá`, `bàn luận`, `nên refactor`, `đánh giá ý tưởng`, `đánh giá chiến lược`, `tác dụng phụ`, `trường hợp biên`
112
+ - **Context:** architectural or tooling decision, scope or effort/value discussion, a big or hard-to-reverse decision, a request for first-principles/critique-style thinking, or *discussing/evaluating* (rather than just executing) a refactor, a code review, a strategy/plan, or an idea — the four cases that trigger Module 5 (MVP focus, side-effects/edge-cases weighed by severity)
113
+
114
+ ### METHOD-proportionality.md
115
+ Load if message contains any of:
116
+ - **Keywords:** `rate limit`, `quota`, `throttle`, `abuse`, `spam`, `bot`, `exploit`, `bypass`, `tamper`, `client-side check`, `guard`, `defensive`, `hardening`, `threat model`, `attack surface`, `over-engineering`, `overthinking`, `paranoid`, `is it worth defending`, `lạm dụng`, `giới hạn`, `chặn`, `hạn mức`, `phòng thủ`, `bảo mật quá mức`, `nghĩ quá nhiều`, `vẽ vời`, `có cần chặn không`, `bao nhiêu user`, `mấy ai làm được`, `rủi ro`, `mức độ nghiêm trọng`
117
+ - **Context:** any proposal to add, keep, size, or remove a guard / limit / validation / permission check; deciding whether a client-side restriction is enough; accepting a risk deliberately; weighing MVP speed against security or abuse resistance. Also load when a discussion is stacking protection with no evidence of who could actually reach the state being protected.
118
+
119
+ ### METHOD-audit-subtraction.md
120
+ Load if message contains any of:
121
+ - **Keywords:** `subtraction audit`, `dead code`, `unused`, `unreferenced`, `bloat`, `strip down`, `minimize the repo`, `tối giản tuyệt đối`, `tối giản tối đa`, `tinh gọn toàn bộ`, `cắt giảm tối đa`, `dọn sạch repo`, `xoá code thừa`, `code chết`, `refactor hạng nặng`, `không còn gì để bớt`, `gọn nhất có thể`
122
+ - **Context:** a request to minimize or strip an existing repository rather than to check its correctness. Pairs with `METHOD-audit-zero-trust.md`, whose scope-lock, detector-first order and evidence classes it inherits. Read-only: it reports and plans removals, it never deletes.
123
+
124
+ ---
125
+
126
+ ## Tier 2 — Full load
127
+
128
+ **Trigger** — match any of the following (case-insensitive): `nạp full`, `load full`, `full load`, `nạp tất cả rule`, `load all rules`, `full akirule`, `nạp hết rule`
129
+
130
+ **Protocol — execute in order:**
131
+ 1. Run `ls ~/.aki/akidevrule/RULE-*.md ~/.aki/akidevrule/METHOD-*.md` to discover the actual file list
132
+ 2. Read each file returned (skip anything under `ref-ECC/`)
133
+ 3. Emit the `[RULES]` receipt per § Load confirmation, with the loaded set marked `(router:full)`
134
+
135
+ ---
136
+
137
+ ## Load confirmation — the `[RULES]` receipt
138
+
139
+ One line at the start of the response, reporting the **whole rule context**, not this skill's delta:
140
+
141
+ ```
142
+ [RULES] agent,coding,pattern (core) + docs,ui (router) | missing: none
143
+ ```
144
+
145
+ | Element | Rule |
146
+ |---|---|
147
+ | Names | topic addresses per the manifest Topic column (`~/.aki/akidevrule/index.md` § addressing scheme). No new vocabulary. |
148
+ | `(core)` | the four `@`-imported files. Always listed, even though this skill did not load them: their presence is otherwise unobservable, and they are the most-violated group. Listing them reports context state; it does not claim credit for the load. |
149
+ | `(router)` | files this skill loaded this turn. Tier 2 writes `(router:full)`. |
150
+ | `(brief)` | for a worker/subagent — the files its spawning prompt named and it actually read. A worker inherits no router, so it uses this instead of `(router)` and emits the line as the first line of its single round (`agent.A5`). |
151
+ | `missing:` | every file that was required and could not be read, else `none`. `[RULES] none \| missing: agent` is the loudest case and the reason this field exists. |
152
+
153
+ **The line is mandatory.** The session agent emits it on its first response of the session, and again on any turn where the set changes; a worker emits it always. Silence is never "nothing loaded" — a missing line is indistinguishable from a router that never ran, and those are different bugs with opposite fixes. With the line mandatory, a later turn without one carries exactly one meaning: the set is unchanged since the last line printed.
154
+
155
+ The receipt is **self-reported: a diagnostic signal, never evidence** (`agent.B2`). Do not gate closure on it. The cross-check that does carry weight is the agent definition's declared rule manifest against the line it emitted — a mismatch is a finding.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: akiship
3
+ description: Full release ritual end-to-end — front-loaded checks, then an unattended pass. ACTIVATION IS LITERAL: this skill runs only on a user turn containing the exact token `/akiship` that asks for the run to be performed. Nothing else activates it — not the bare word "akiship", not a release-flavored paraphrase, and never a completion-intensity phrase on its own ("trọn vẹn" and its siblings — canonical list in RULE-release.md B8): outside a valid invocation those are ordinary vocabulary carrying zero authorization to fix, commit, push, tag, or release. `/akiship` inside a question means consult the checklist and answer in chat — read-only. Sequences RULE-release.md B7's checklist under the B8 autonomy contract; the escalation floor, completion-intensity semantics, and push/deploy authorization are owned by B8 and referenced, never restated, here.
4
+ ---
5
+
6
+ # akiship — one-command full release
7
+
8
+ Invoke with the literal `/akiship`, and only as described in § Activation gate below. Goal: replace the daily hand-typed ritual ("resolve leftovers, sync every doc, lint, fix drift, changelog, commit, release…") with one invocation that runs to completion or stops once, early, with every blocker in a single batch.
9
+
10
+ **This skill sequences; it does not own content.** The checklist is `RULE-release.md` B7 and the autonomy/escalation contract is B8 — read that file first (installed at `~/.aki/akidevrule/RULE-release.md`), plus `RULE-docs.md` for the doc-sync step. If a step here ever disagrees with the rule file, the rule file wins — except the activation gate below, which this skill owns outright (`pattern.A1`) and which no rule file, keyword list, or routing table may widen.
11
+
12
+ ## Activation gate — two conditions, both required, checked before anything else
13
+
14
+ **1. The literal token.** The current user turn contains the exact string `/akiship`. Nothing else activates this skill: not the bare word "akiship", not a release-flavored paraphrase ("release trọn gói", "chạy full release", "ship đợt này"), and above all not a completion-intensity phrase standing on its own (e.g. "trọn vẹn" — canonical list: `release.B8`). Those are how an owner talks while thinking about finishing something — reading one as an invocation turns a conversation into a push to a public remote. Seeing this file, or `release.B8`, in context is not an invocation either: being loaded is not being called.
15
+
16
+ **2. Imperative, not interrogative** (`agent.A3`). The token alone authorizes nothing — the turn must ask for the run to be *performed*.
17
+
18
+ | Turn | Mode |
19
+ |---|---|
20
+ | `/akiship` · "thực hiện /akiship trọn vẹn" · "chạy /akiship đi" | **execute** — run the phases below |
21
+ | "nếu chạy /akiship thì cần gì để trọn vẹn?" · "/akiship sẽ làm những gì?" · "/akiship có push không?" | **consult** — read the checklist below and answer in chat what the run would do and what is still open on this tree; edit no file, no commit, no push, no tag, no release |
22
+
23
+ Consult is the default whenever both readings are available. A withheld execution costs one extra turn; a wrongly performed one costs a published push that cannot be taken back (`agent.A3` — calibrate by reversibility).
24
+
25
+ ## Phase 1 — front check (all asks happen here or never)
26
+
27
+ 1. Derive release state cold per `release.B1` (manifest, CHANGELOG top, boundary commit, accumulation log).
28
+ 2. Triage the tree per B7 step 0 (the `/akigitcommit` step-0 taxonomy; read-only, `agent.B5`).
29
+ - Registry-published package (`package.json` without `"private": true`, `Cargo.toml`, `pyproject.toml`): probe the account facts and 2FA mode per `release.B9` now, so the publish hand-off is known before the run starts, not discovered at its end.
30
+ 3. Collect every hit on the B8 escalation floor — the three stop conditions and everything about completion-intensity phrasing are defined in `release.B8`, not here. Completion-intensity phrasing is read only inside an execute-mode invocation that already passed § Activation gate, and applies with exactly B8's two effects: the unclassifiable-work stop resolves toward mid-edit, and the push/deploy naming requirement is satisfied (Phase 3 step 4). Any hit on the two conditions no phrasing waives → report every hit in one batch and stop. No hits → proceed; from here the run asks nothing (`release.B8`: a question the repo already answers is a violation).
31
+
32
+ ## Phase 2 — gate, fixing in place
33
+
34
+ Run B7 steps 2–6 in order, fixing findings as they surface (this is a gate, not an audit — no findings doc):
35
+
36
+ - **Hygiene, diff scope only**: `python3 ~/.claude/skills/akiflow/scripts/scythe.py <files changed since boundary>` for `[WRAP]`/`[YAP]`; dead code / redundant guards / duplication the accumulation introduced (`pattern.A8`); doc refs in touched comments still resolve (`docs.B3`). Never widen to the whole repo.
37
+ - External-action completeness — a pending migration qualifying under `stack.C8`'s execution-ownership clause (additive, idempotent, backup path available) is run here, not deferred; record truthfulness (CHANGELOG + `releases.json` parity where it exists), doc sync over every record surface B7 step 5 enumerates (plans → `done/`, `arch`/`feat` stamps per `docs.A4`, `README.md`, the task-note file via `akidevsync-notes`, any standards doc the project `CLAUDE.md` binds to), verification honesty — anything else runtime-only, or a migration that does not qualify, is carried to the final report as **unverified**, never silently assumed (`coding.B3`).
38
+
39
+ ## Phase 3 — commit, mint, artifacts
40
+
41
+ 1. Commit in logical groups per `/akigitcommit` (domain-grouped mode; anti-stage-loss rules apply in full). B8 pre-answers its confirmation step — "commit luôn" semantics.
42
+ 2. Version decision per `release.A4`/`A5`: mint exactly once at the highest accumulated severity, or defer on the materiality test. Deferring is a normal outcome, not a failure.
43
+ 3. Artifacts per the repo's own convention: bare tag only if the repo already tags (`release.A3` B8 exception); GitHub Release per `release.B4`; `releases.json` sync check per `release.C4`; registry publish per `release.B9` — tarball verified first, and an OTP-gated publish is the report's single hand-off with its `npm view` check.
44
+ 4. **Push / deploy only if B8's push/deploy authorization holds for this invocation (named explicitly, or completion-intensity phrasing per `release.B8`).** Otherwise the run stays local-only. If pushed and the stack deploys, run live verification per `release.C5` afterward.
45
+
46
+ ## Report
47
+
48
+ One dense summary (`agent.A4`): state derived → findings fixed (counts per gate step) → commits made → version minted or deferred with the reason → artifacts created → anything left **unverified**, each with the exact command that would settle it.
49
+
50
+ ## Boundaries
51
+
52
+ - Never run a phase above on a turn that failed either activation condition — answer in consult mode instead, and never treat your own consult answer as the go-ahead for a later turn.
53
+ - The B8 escalation floor is the only reason to stop mid-run; everything else is self-answered from repo, docs, and rules.
54
+ - Never push, deploy, or push tags without B8's push/deploy authorization (`release.B8`).
55
+ - A repo-wide hygiene/subtraction sweep is out of scope — point the user at `METHOD-audit-subtraction.md` instead of widening the gate.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: akithink
3
+ description: Structured deep-thinking session between agent and human for important decisions — restate the problem, excavate the goal chain to the ultimate goal, first-principles decomposition (facts/constraints/assumptions), mandatory critique (steelman, inversion, pre-mortem), then converge into a decision record. For big / hard-to-reverse / goal-ambiguous problems — small inline questions are already covered passively by akirule + METHOD-deep-think. Recommends running on a top-tier model (Opus/Fable).
4
+ ---
5
+
6
+ # akithink — structured deep-thinking session
7
+
8
+ Invoke with `/akithink`, or when the user explicitly asks for a deep-thinking session on a decision ("let's think this through properly", "hãy tư duy sâu về việc này", "cần một session suy nghĩ kỹ"). This is the **active** consumption mode of `payload/METHOD-deep-think.md` — the same analytical brain that akirule loads passively for ordinary tasks, run here at maximum depth through an interactive protocol.
9
+
10
+ ## When NOT to use this skill
11
+
12
+ Small, reversible, low-cost-of-error decisions should just be decided. Casual "should we…?" questions are already handled inline by akirule auto-loading `METHOD-deep-think.md` passively — that is enough for two-way-door decisions. Reach for `/akithink` only when the decision is big, hard to reverse (one-way-door), or the goal itself is still unclear. Do not open a session for something that a one-paragraph answer would resolve.
13
+
14
+ ## Toolbox
15
+
16
+ At session start, Read `~/.aki/akidevrule/METHOD-deep-think.md`. It is the toolbox for every phase below — do not re-derive the modules from memory.
17
+
18
+ ## Phase 0 — model check
19
+
20
+ If the current model is Haiku or Sonnet, print a recommendation: deep-thinking sessions are best run on a top-tier model (Opus/Fable) — suggest `/model` then re-invoke `/akithink`. This is a **recommendation only, never a block** — if the user wants to continue on the current model, proceed.
21
+
22
+ ## Phase 1 — restate
23
+
24
+ Restate the problem in your own words. Wait for the user to confirm or correct it. **Do not proceed to Phase 2 on an unconfirmed restatement** — a session built on a misunderstood problem wastes the whole point of slowing down.
25
+
26
+ ## Phase 2 — goal excavation
27
+
28
+ Apply METHOD Module 1 (goal excavation). Climb the goal hierarchy to the ultimate goal; produce the explicit goal chain; call out conflicting goals.
29
+
30
+ ## Phase 3 — first principles
31
+
32
+ Apply METHOD Module 2 (facts / real constraints / assumptions). If the problem has business or product context, also apply Module 4 (techbiz lens). Skip Module 4 explicitly, and say so, when the problem is a personal tool, art project, or pure research question.
33
+
34
+ ## Phase 4 — critique
35
+
36
+ Apply METHOD Module 3 (critique). **Mandatory, even if the user and agent already agree** — steelman the opposing option, attack the favored option, inversion, pre-mortem, second-order effects. Anti-sycophancy rule applies here exactly as in the METHOD: no "great idea!"-style agreement without critique.
37
+
38
+ ## Phase 5 — convergence
39
+
40
+ Converge into a decision record with:
41
+ - the decision
42
+ - rationale
43
+ - rejected alternatives, with reasons
44
+ - assumptions to monitor going forward
45
+
46
+ Then:
47
+ 1. **Always propose writing a decision record** under `docs/`, following `RULE-docs.md` conventions (read `~/.aki/akidevrule/RULE-docs.md` to align the exact path and lifecycle — typically `docs/research/` for the record of how the decision was reached, or `docs/plan/` if it converts directly into an execution plan).
48
+ 2. **If** the converged material is large or complex (many decision points, several rejected options, interlocking tradeoffs), additionally suggest `/akihtmlreport` to visualize it. The docs file is the durable source of truth; the HTML is a view, not a replacement — do not suggest the HTML report as a substitute for writing the doc.
49
+
50
+ ## Interaction rules
51
+
52
+ - **Pacing:** ask 1–2 highest-value questions per turn. `AskUserQuestion` is fine for discrete choices. Never dump a full questionnaire in one turn.
53
+ - **Escape hatch:** the user can say "chốt" (or an equivalent "let's converge/decide now") at any point to jump straight to Phase 5 with whatever has been established so far.
54
+ - **Anti-sycophancy:** same rule as METHOD Module 3 — do not agree without critique, in any phase.
55
+ - **Anti-overuse guard:** if the problem turns out to be small and reversible once restated in Phase 1, say so and offer to just decide it directly instead of running the full protocol.
56
+
57
+ ## Invocation scope
58
+
59
+ This skill is **explicit-invoke only** — akirule does not auto-trigger it. The signals that matter for auto-loading live on `METHOD-deep-think.md` (passive mode); this skill itself is reached only when the user asks for it by name or in equivalent words.