From 6ce2dbf2f6f9f47de4be1a57611d1d6e4a003212 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Tue, 14 Jul 2026 22:00:08 +0800 Subject: [PATCH 1/5] refactor(okf): migrate to skills-dir plugin Consolidates okf-wiki-maintenance.sh, okf-wiki-review.txt, SKILL.md, and the SessionEnd hook registration from three separate locations into a single self-contained skills-dir plugin at ~/.claude/skills/okf/. Hook registration moves from settings.json to hooks/hooks.json, co-located with the script it references. --- README.md | 13 +- .../skills/okf/.claude-plugin/plugin.json | 4 + .../private_dot_claude/skills/okf/SKILL.md | 75 +++ chezmoi/private_dot_claude/skills/okf/SPEC.md | 459 ++++++++++++++++++ .../skills/okf/hooks/hooks.json | 16 + .../executable_okf-wiki-maintenance.sh | 0 .../okf/scripts}/okf-wiki-review.txt | 0 .../skills/okf/templates/concept.md | 24 + .../skills/okf/templates/index.md | 8 + .../skills/okf/templates/log.md | 7 + chezmoi/private_dot_claude/skills/symlink_okf | 1 - 11 files changed, 596 insertions(+), 11 deletions(-) create mode 100644 chezmoi/private_dot_claude/skills/okf/.claude-plugin/plugin.json create mode 100644 chezmoi/private_dot_claude/skills/okf/SKILL.md create mode 100644 chezmoi/private_dot_claude/skills/okf/SPEC.md create mode 100644 chezmoi/private_dot_claude/skills/okf/hooks/hooks.json rename chezmoi/private_dot_claude/{okf => skills/okf/scripts}/executable_okf-wiki-maintenance.sh (100%) rename chezmoi/private_dot_claude/{okf => skills/okf/scripts}/okf-wiki-review.txt (100%) create mode 100644 chezmoi/private_dot_claude/skills/okf/templates/concept.md create mode 100644 chezmoi/private_dot_claude/skills/okf/templates/index.md create mode 100644 chezmoi/private_dot_claude/skills/okf/templates/log.md delete mode 100644 chezmoi/private_dot_claude/skills/symlink_okf diff --git a/README.md b/README.md index a5a73c0d..b922acd0 100644 --- a/README.md +++ b/README.md @@ -56,19 +56,12 @@ pre-commit install ## Claude Code plugins -Personal plugins in `plugins/` are served as a local marketplace. Registered by `chezmoi apply` -pointing directly at this directory — no deployment step, edits take effect immediately. +Personal skills-directory plugin deployed by `chezmoi apply` to `~/.claude/skills/okf/`. +Loaded automatically as `okf@skills-dir` on session start — no install step. Current plugins: -- `okf-wiki` — SessionEnd hook that distills memsearch journals into the `~/wiki` OKF bundle - -To install without cloning the repo: - -```bash -claude plugin marketplace add "https://github.com/yxtay/dotfiles" --sparse plugins -claude plugin install okf-wiki@yxtay -``` +- `okf` — OKF skill + SessionEnd hook that distills memsearch journals into the `~/wiki` OKF bundle ## License diff --git a/chezmoi/private_dot_claude/skills/okf/.claude-plugin/plugin.json b/chezmoi/private_dot_claude/skills/okf/.claude-plugin/plugin.json new file mode 100644 index 00000000..4ca15e67 --- /dev/null +++ b/chezmoi/private_dot_claude/skills/okf/.claude-plugin/plugin.json @@ -0,0 +1,4 @@ +{ + "name": "okf", + "description": "Open Knowledge Format (OKF) skill and wiki maintenance hook — distills memsearch journals into ~/wiki" +} diff --git a/chezmoi/private_dot_claude/skills/okf/SKILL.md b/chezmoi/private_dot_claude/skills/okf/SKILL.md new file mode 100644 index 00000000..bf697233 --- /dev/null +++ b/chezmoi/private_dot_claude/skills/okf/SKILL.md @@ -0,0 +1,75 @@ +--- +name: okf +description: >- + Create and maintain knowledge bundles in Open Knowledge Format (OKF) — + markdown + YAML-frontmatter concept files for durable knowledge. Use when + the user wants to write, structure, or validate an OKF bundle, add a + "concept" document, build an `index.md`/`log.md`, cross-link concepts, or + asks "is this OKF-conformant". +user-invocable: true +argument-hint: "[produce|maintain|consume] [bundle-path]" +--- + +# Open Knowledge Format (OKF) skill + +OKF is a directory of markdown files with YAML frontmatter. Work from the spec — +[SPEC.md](SPEC.md) is the source of truth. + +## The one hard rule + +Conformant (§9): every non-reserved `.md` file has parseable YAML frontmatter +with a **non-empty `type`** field. Everything else is soft guidance — tolerate +missing optional fields, unknown types, and broken links. + +## Conventions + +- **One concept = one file.** File path minus `.md` is the concept ID. +- **Bundle path:** use what comes from context — `~/wiki` (personal wiki) or + `.okf/` (project bundle) are common. Use the path from the task; invent none. +- **Frontmatter:** `type` required. Add `title`, `description`, `tags`, + `timestamp` (ISO 8601) when useful; `resource` (canonical URI) only for + concepts bound to a real asset. +- **Body:** structural markdown (tables, lists, fenced code) over prose. + Conventional headings: `# Schema`, `# Examples`, `# Citations`. +- **Cross-links:** standard markdown links; absolute bundle-relative form + (`/services/auth-api.md`) preferred. Relationship kind belongs in prose. +- **Reserved:** `index.md` (directory listing) and `log.md` (ISO-dated history, + newest first) — concepts never use these names. + +Templates: [concept](templates/concept.md), [index](templates/index.md), +[log](templates/log.md). + +## Modes + +### produce — create or extend a bundle + +1. Read [SPEC.md](SPEC.md). +2. Choose sources: **code** (source, READMEs, docstrings, config), **docs/wiki** + (distill into concepts; cite originals under `# Citations`), **manual** + (decisions, playbooks, metrics). +3. Lay out directories by domain (`services/`, `datasets/`, `decisions/`). +4. Write each concept from [templates/concept.md](templates/concept.md): set a + descriptive `type`, fill recommended fields, cross-link related concepts. +5. Add/refresh `index.md` per directory (`okf_version: "0.1"` in root index) + and append to `log.md`. Done when every new or changed concept has an + `index.md` entry. + +### maintain — sync a bundle with reality + +1. Triage affected concepts by `resource`, path, or topic — cover every one. +2. Update body and `timestamp`; add or fix cross-links; create concepts for new + assets; mark removed assets with `**Deprecation**` to preserve context. +3. Update `index.md` entries and append to `log.md`. + +### consume — use a bundle as context + +1. Read the bundle-root `index.md` first, then follow links into relevant + concepts only. +2. Broken links are not-yet-written knowledge, not errors. +3. When you learn something durable, switch to **maintain** and write it back. + +## Before declaring done + +- Every concept written or touched: parseable frontmatter, non-empty `type`. +- `index.md` updated for any new concepts. +- `log.md` entry appended if the bundle has one. diff --git a/chezmoi/private_dot_claude/skills/okf/SPEC.md b/chezmoi/private_dot_claude/skills/okf/SPEC.md new file mode 100644 index 00000000..22b4d8a5 --- /dev/null +++ b/chezmoi/private_dot_claude/skills/okf/SPEC.md @@ -0,0 +1,459 @@ + + + +# Open Knowledge Format (OKF) + +**Version 0.1 — Draft** + +OKF is an open, human- and agent-friendly format for representing +*knowledge* — the metadata, context, and curated insight that surrounds +data and systems. It is designed to be authored by people, generated by +agents, exchanged across organizations, and consumed by both. + +The format is intentionally minimal: a directory of markdown files with +YAML frontmatter. There is no schema registry, no central authority, and +no required tooling. If you can `cat` a file, you can read OKF; if you +can `git clone` a repo, you can ship it. + +--- + +## 1. Motivation + +The space of knowledge representation for AI agents is evolving quickly, +and many incompatible conventions are emerging. OKF takes the position +that knowledge is best represented in commonly accessible, established +formats that are: + +- **Readable** by humans without tooling. +- **Parseable** by agents without bespoke SDKs. +- **Diffable** in version control. +- **Portable** across tools, organizations, and time. + +The format is minimally opinionated. It standardizes only the small set +of structural conventions needed to make a knowledge corpus +*self-describing* — anything beyond that is left to the producer. + +### Goals + +1. Define a universal format that **enrichment agents** can write into. +2. Inform how **consumption agents** should read and traverse it. +3. Facilitate **exchange** of knowledge across systems and organizations. +4. Standardize the small number of **required** fields that must be + present for content to be meaningfully consumed. + +### Non-goals + +- Defining a fixed taxonomy of concept types. +- Prescribing storage, serving, or query infrastructure. +- Replacing domain-specific schemas (Avro, Protobuf, OpenAPI, etc.) — + OKF *references* them; it does not subsume them. + +--- + +## 2. Terminology + +- **Knowledge Bundle** — A self-contained, hierarchical collection of + knowledge documents. The unit of distribution. +- **Concept** — A single unit of knowledge within a bundle. Represented + as one markdown document. May describe a tangible asset (a table, an + API), an abstract idea (a metric, a business process), or anything in + between. +- **Concept ID** — The path of the concept's file within the bundle, + with the `.md` suffix removed. For example, `tables/users.md` has + concept ID `tables/users`. +- **Frontmatter** — YAML metadata block delimited by `---` at the top of + a markdown file. +- **Body** — Everything in the file after the frontmatter. +- **Link** — A standard markdown link from one concept to another, used + to express relationships beyond the implicit parent/child hierarchy. +- **Citation** — A link from a concept to an external source that + supports a claim in the body. + +--- + +## 3. Bundle Structure + +A bundle is a directory tree of markdown files. The directory structure +is independent of the domain — producers organize concepts however makes +sense for the knowledge being captured. + +``` +path/to/bundle/ +├── index.md # Optional. Directory listing for progressive disclosure. +├── log.md # Optional. Chronological history of updates. +├── .md # A concept at the bundle root. +└── / # Subdirectories organize concepts into groups. + ├── index.md + ├── .md + └── / + └── … +``` + +A bundle MAY be distributed as: + +- A git repository (recommended — provides history, attribution, diffs). +- A tarball or zip archive of the directory. +- A subdirectory within a larger repository. + +### 3.1 Reserved filenames + +The following filenames have defined meaning at any level of the +hierarchy and MUST NOT be used for concept documents: + +| Filename | Purpose | +|------------|----------------------------| +| `index.md` | Directory listing. See §6. | +| `log.md` | Update history. See §7. | + +All other `.md` files are concept documents. + +Tags themselves remain a first-class concept — see the `tags` +frontmatter field in §4.1. OKF does not specify a separate file format +for aggregating documents by tag; producers that want a tag-browsing +view can synthesize one at consumption time by scanning frontmatter. + +--- + +## 4. Concept Documents + +Every concept is a UTF-8 markdown file. It has two parts: + +1. A **YAML frontmatter block**, delimited by `---` on its own line at + the start of the file and a closing `---` on its own line. +2. A **markdown body**, containing free-form content. + +### 4.1 Frontmatter + +```yaml +--- +type: # REQUIRED +title: +description: +resource: +tags: [, , …] # Optional +timestamp: # Optional last-modified time +# … other producer-defined key/value pairs +--- +``` + +**Required:** + +- `type` — A short string identifying the kind of concept. Consumers + use this for routing, filtering, and presentation. Example values: + `BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, + `Playbook`, `Reference`. + + Type values are **not** registered centrally. Producers SHOULD pick + values that are descriptive and self-explanatory; consumers MUST + tolerate unknown types gracefully (typically by treating them as + generic concepts). + +**Recommended (in priority order):** + +- `title` — Human-readable display name. If omitted, consumers MAY + derive a title from the filename. +- `description` — A single sentence summarizing the concept. Used by + `index.md` generators, search snippets, and previews. +- `resource` — A URI that uniquely identifies the underlying asset the + concept describes. Absent for concepts that describe abstract ideas + rather than physical resources. +- `tags` — A YAML list of short strings for cross-cutting categorization. +- `timestamp` — ISO 8601 datetime of last meaningful change. + +**Extensions:** Producers MAY include any additional keys. Consumers +SHOULD preserve unknown keys when round-tripping and SHOULD NOT reject +documents with unrecognized fields. + +### 4.2 Body + +The body is standard markdown. Producers SHOULD favor structural +markdown — headings, lists, tables, fenced code blocks — over freeform +prose, since structure aids both human reading and agent retrieval. + +There are no required body sections. The following section headings have +**conventional** meaning and SHOULD be used when applicable: + +| Heading | Purpose | +|---------------|-------------------------------------------------------| +| `# Schema` | Structured description of an asset's columns/fields. | +| `# Examples` | Concrete usage examples, often as fenced code blocks. | +| `# Citations` | External sources backing claims in the body. See §8. | + +### 4.3 Example: a concept bound to a resource + +```markdown +--- +type: BigQuery Table +title: Customer Orders +description: One row per completed customer order across all channels. +resource: https://console.cloud.google.com/bigquery?p=acme&d=sales&t=orders +tags: [sales, orders, revenue] +timestamp: 2026-05-28T14:30:00Z +--- + +# Schema + +| Column | Type | Description | +|---------------|-----------|-----------------------------------------------------| +| `order_id` | STRING | Globally unique order identifier. | +| `customer_id` | STRING | Foreign key into [customers](/tables/customers.md). | +| `total_usd` | NUMERIC | Order total in US dollars. | +| `placed_at` | TIMESTAMP | When the customer submitted the order. | + +# Joins + +Joined with [customers](/tables/customers.md) on `customer_id`. + +# Citations + +[1] [BigQuery table schema](https://console.cloud.google.com/bigquery?p=acme&d=sales&t=orders) +``` + +### 4.4 Example: a concept not bound to a resource + +```markdown +--- +type: Playbook +title: Incident response — data freshness alert +description: Steps to triage a freshness alert on the orders pipeline. +tags: [oncall, incident] +timestamp: 2026-04-12T09:00:00Z +--- + +# Trigger + +A freshness alert fires when `orders` lags more than 30 minutes behind +its expected SLA. See the [orders table](/tables/orders.md). + +# Steps + +1. Check the [ingestion job dashboard](https://example.com/dash). +2. … +``` + +--- + +## 5. Cross-linking + +Concepts MAY link to other concepts using standard markdown links. Two +forms are supported: + +### 5.1 Absolute (bundle-relative) links + +Begin with `/`, interpreted relative to the bundle root. + +```markdown +See the [customers table](/tables/customers.md) for the join key. +``` + +This is the **recommended** form because it is stable when documents are +moved within their subdirectory. + +### 5.2 Relative links + +Standard markdown relative paths. + +```markdown +See the [neighboring concept](./other.md). +``` + +### 5.3 Link semantics + +A link from concept A to concept B asserts a *relationship*. The +specific kind of relationship (parent/child, references, joins-with, +depends-on, etc.) is conveyed by the surrounding prose, not by the link +itself. Consumers that build a graph view typically treat all links as +directed edges of an untyped relationship. + +Consumers MUST tolerate broken links — a link whose target does not +exist in the bundle is not malformed; it may simply represent +not-yet-written knowledge. + +--- + +## 6. Index Files + +An `index.md` file MAY appear in any directory, including the bundle +root. It enumerates the directory's contents to support **progressive +disclosure** — letting a human or agent see what is available before +opening individual documents. + +Index files contain no frontmatter. The body uses one or more sections, +each grouping concepts under a heading: + +```markdown +# Section / Group Heading + +* [Title 1](relative-url-1) - short description of item 1 +* [Title 2](relative-url-2) - short description of item 2 + +# Another Section + +* [Subdirectory](subdir/) - short description of the subdirectory +``` + +Entries SHOULD include the description from the linked concept's +frontmatter. Producers MAY generate `index.md` automatically; consumers +MAY synthesize one on the fly when none is present. + +--- + +## 7. Log Files (optional) + +A `log.md` file MAY appear at any level of the hierarchy to record the +history of changes to that scope. The format is a flat list of +date-grouped entries, newest first: + +```markdown +# Directory Update Log + +## 2026-05-22 +* **Update**: Added new BigQuery table reference for [Customer Metrics](/tables/customer-metrics.md). +* **Creation**: Established the [Dataplex Playbook](/playbooks/dataplex.md). + +## 2026-05-15 +* **Initialization**: Created foundational directory structure. +* **Update**: Added progressive-disclosure guidelines to the root [index](/index.md). +``` + +Date headings MUST use ISO 8601 `YYYY-MM-DD` form. Log entries are +prose; the leading bold word (`**Update**`, `**Creation**`, +`**Deprecation**`, etc.) is a convention, not a requirement. + +--- + +## 8. Citations + +When a concept's body makes claims sourced from external material, +those sources SHOULD be listed under a `# Citations` heading at the +bottom of the document, numbered: + +```markdown +# Citations + +[1] [BigQuery public dataset announcement](https://cloud.google.com/blog/products/data-analytics/...) +[2] [Internal data quality runbook](https://wiki.acme.internal/data/quality) +``` + +Citation links MAY be absolute URLs, bundle-relative paths, or paths +into a `references/` subdirectory that mirrors external material as +first-class OKF concepts. + +--- + +## 9. Conformance + +A bundle is **conformant** with OKF v0.1 if: + +1. Every non-reserved `.md` file in the tree contains a parseable YAML + frontmatter block. +2. Every frontmatter block contains a non-empty `type` field. +3. Every reserved filename (`index.md`, `log.md`) follows the structure + described in §6 and §7 respectively when present. + +Consumers SHOULD treat all other constraints as soft guidance. In +particular, consumers MUST NOT reject a bundle because of: + +- Missing optional frontmatter fields. +- Unknown `type` values. +- Unknown additional frontmatter keys. +- Broken cross-links. +- Missing `index.md` files. + +This permissive consumption model is intentional: OKF is meant to +remain useful as bundles grow, get refactored, and are partially +generated by agents. + +--- + +## 10. Relationship to other formats + +OKF is intentionally close to several established patterns: + +- **LLM "wiki" repositories** that use markdown + frontmatter as + agent-readable knowledge bases. +- **Personal knowledge tools** like Obsidian and Notion, which use + hierarchical markdown with cross-links. +- **"Metadata as code"** approaches that store catalog metadata + alongside source code rather than in a separate registry. + +OKF differs primarily in being **specified** — pinning down the small +set of rules needed for interoperability without dictating tooling. + +--- + +## 11. Versioning + +This document specifies OKF version **0.1**. Future revisions will be +versioned in the form `.`: + +- A **minor** version bump introduces backward-compatible additions + (new optional fields, new conventional section headings). +- A **major** version bump may make breaking changes (renaming required + fields, changing reserved filenames). + +Bundles MAY declare the OKF version they target by including +`okf_version: "0.1"` in a bundle-root `index.md` frontmatter block (the +only place frontmatter is permitted in an `index.md`). Consumers that +do not understand the declared version SHOULD attempt best-effort +consumption rather than refusing the bundle. + +--- + +## Appendix A — Minimal example bundle + +``` +my_bundle/ +├── index.md +├── datasets/ +│ ├── index.md +│ └── sales.md +└── tables/ + ├── index.md + ├── orders.md + └── customers.md +``` + +`datasets/sales.md`: + +```markdown +--- +type: BigQuery Dataset +title: Sales +description: All sales-related tables for the retail business. +resource: https://console.cloud.google.com/bigquery?p=acme&d=sales +tags: [sales] +timestamp: 2026-05-28T00:00:00Z +--- + +The sales dataset contains transactional tables, including +[orders](/tables/orders.md) and [customers](/tables/customers.md). +``` + +`tables/orders.md`: + +```markdown +--- +type: BigQuery Table +title: Orders +description: One row per completed customer order. +resource: https://console.cloud.google.com/bigquery?p=acme&d=sales&t=orders +tags: [sales, orders] +timestamp: 2026-05-28T00:00:00Z +--- + +# Schema + +| Column | Type | Description | +|---------------|---------|------------------------------------------| +| `order_id` | STRING | Unique order identifier. | +| `customer_id` | STRING | FK to [customers](/tables/customers.md). | +| `total_usd` | NUMERIC | Order total in USD. | + +Part of the [sales dataset](/datasets/sales.md). +``` diff --git a/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json b/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json new file mode 100644 index 00000000..2f4b83b2 --- /dev/null +++ b/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json @@ -0,0 +1,16 @@ +{ + "hooks": { + "SessionEnd": [ + { + "hooks": [ + { + "type": "command", + "command": "~/.claude/skills/okf/scripts/okf-wiki-maintenance.sh", + "async": true, + "timeout": 300 + } + ] + } + ] + } +} diff --git a/chezmoi/private_dot_claude/okf/executable_okf-wiki-maintenance.sh b/chezmoi/private_dot_claude/skills/okf/scripts/executable_okf-wiki-maintenance.sh similarity index 100% rename from chezmoi/private_dot_claude/okf/executable_okf-wiki-maintenance.sh rename to chezmoi/private_dot_claude/skills/okf/scripts/executable_okf-wiki-maintenance.sh diff --git a/chezmoi/private_dot_claude/okf/okf-wiki-review.txt b/chezmoi/private_dot_claude/skills/okf/scripts/okf-wiki-review.txt similarity index 100% rename from chezmoi/private_dot_claude/okf/okf-wiki-review.txt rename to chezmoi/private_dot_claude/skills/okf/scripts/okf-wiki-review.txt diff --git a/chezmoi/private_dot_claude/skills/okf/templates/concept.md b/chezmoi/private_dot_claude/skills/okf/templates/concept.md new file mode 100644 index 00000000..08f6f977 --- /dev/null +++ b/chezmoi/private_dot_claude/skills/okf/templates/concept.md @@ -0,0 +1,24 @@ +--- +type: CONCEPT_TYPE +title: DISPLAY_NAME +description: Single sentence summarizing the concept. +resource: CANONICAL_URI_omit_for_abstract_concepts +tags: [TAG] +timestamp: 2026-01-01T00:00:00Z +--- + +## Overview + +What this concept is and why it matters. + +## Schema + +Use for assets with fields/columns; otherwise replace with relevant sections. + +| Field | Type | Description | +|-------|------|-------------| +| | | | + +## Citations + +[1] [source title](url) diff --git a/chezmoi/private_dot_claude/skills/okf/templates/index.md b/chezmoi/private_dot_claude/skills/okf/templates/index.md new file mode 100644 index 00000000..39ee8777 --- /dev/null +++ b/chezmoi/private_dot_claude/skills/okf/templates/index.md @@ -0,0 +1,8 @@ +# Group Heading + +- [Title](relative-url) - short description from the concept's frontmatter +- [Title](relative-url) - short description + +## Another Group + +- [Subdirectory](subdir/) - short description of the subdirectory diff --git a/chezmoi/private_dot_claude/skills/okf/templates/log.md b/chezmoi/private_dot_claude/skills/okf/templates/log.md new file mode 100644 index 00000000..426f6cf1 --- /dev/null +++ b/chezmoi/private_dot_claude/skills/okf/templates/log.md @@ -0,0 +1,7 @@ +# Update Log + +## YYYY-MM-DD + +- **Creation**: what was created — [concept](bundle-relative-path). +- **Update**: what changed — [concept](bundle-relative-path). +- **Deprecation**: what was retired — [concept](bundle-relative-path). diff --git a/chezmoi/private_dot_claude/skills/symlink_okf b/chezmoi/private_dot_claude/skills/symlink_okf deleted file mode 100644 index 5bb06505..00000000 --- a/chezmoi/private_dot_claude/skills/symlink_okf +++ /dev/null @@ -1 +0,0 @@ -../../.agents/skills/okf From 8bb9300154c6cd775a237ab1c577b9ce4f06f635 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Tue, 14 Jul 2026 22:09:06 +0800 Subject: [PATCH 2/5] fix(okf): rename .claude-plugin to dot_claude-plugin for chezmoi --- .../skills/okf/{.claude-plugin => dot_claude-plugin}/plugin.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename chezmoi/private_dot_claude/skills/okf/{.claude-plugin => dot_claude-plugin}/plugin.json (100%) diff --git a/chezmoi/private_dot_claude/skills/okf/.claude-plugin/plugin.json b/chezmoi/private_dot_claude/skills/okf/dot_claude-plugin/plugin.json similarity index 100% rename from chezmoi/private_dot_claude/skills/okf/.claude-plugin/plugin.json rename to chezmoi/private_dot_claude/skills/okf/dot_claude-plugin/plugin.json From 9e3737955b4b054d05688872b493d6c109a8486e Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Tue, 14 Jul 2026 22:12:43 +0800 Subject: [PATCH 3/5] fix(okf): use $CLAUDE_PLUGIN_ROOT in hook command --- chezmoi/private_dot_claude/skills/okf/hooks/hooks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json b/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json index 2f4b83b2..8b1bcc3a 100644 --- a/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json +++ b/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json @@ -5,7 +5,7 @@ "hooks": [ { "type": "command", - "command": "~/.claude/skills/okf/scripts/okf-wiki-maintenance.sh", + "command": "${CLAUDE_PLUGIN_ROOT}/scripts/okf-wiki-maintenance.sh", "async": true, "timeout": 300 } From 595786c9de9c4f431b0bfd506768f9b88886ade8 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Wed, 15 Jul 2026 11:19:57 +0800 Subject: [PATCH 4/5] feat(claude): add mattpocock skills plugin and enable 1m context models - Add mattpocock/skills marketplace and mattpocock-skills plugin to claude setup - Update mattpocock repo skills list with new skills (resolving-merge-conflicts, ask-matt, teach, grill-me) - Remove claude-code from ephemeral agent installs (handled by plugin now) - Enable 1m context variants for all bedrock model overrides and env vars Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../run_onchange_after_agent_plugins.sh.tmpl | 10 ++++------ .../run_onchange_after_setup_claude.sh.tmpl | 2 ++ chezmoi/.chezmoitemplates/claude-settings.json | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/chezmoi/.chezmoiscripts/run_onchange_after_agent_plugins.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_after_agent_plugins.sh.tmpl index 8229179b..c8cba105 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_after_agent_plugins.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_after_agent_plugins.sh.tmpl @@ -24,14 +24,12 @@ if command -v rtk >/dev/null; then fi agents=(opencode) -{{- if not .is_ephemeral }} -agents+=(claude-code) -{{- end }} repo_skills=( - mattpocock/skills=wayfinder,grill-with-docs,to-spec,to-tickets,implement,diagnosing-bugs - mattpocock/skills=grilling,domain-modeling,research,prototype,codebase-design,tdd,triage,handoff - mattpocock/skills=setup-matt-pocock-skills,improve-codebase-architecture,writing-great-skills + mattpocock/skills=wayfinder,grill-with-docs,to-spec,to-tickets,triage,handoff,implement + mattpocock/skills=grilling,domain-modeling,research,prototype,codebase-design,tdd,diagnosing-bugs + mattpocock/skills=resolving-merge-conflicts,improve-codebase-architecture + mattpocock/skills=ask-matt,setup-matt-pocock-skills,writing-great-skills,teach,grill-me philschmid/mcp-cli=mcp-cli ) for entry in "${repo_skills[@]}"; do diff --git a/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl index 2767bf3d..564d3695 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl @@ -10,6 +10,7 @@ fi marketplaces=( anthropics/claude-plugins-official JuliusBrussee/caveman + mattpocock/skills zilliztech/memsearch ) for entry in "${marketplaces[@]}"; do @@ -24,6 +25,7 @@ plugins=( pyright-lsp@claude-plugins-official typescript-lsp@claude-plugins-official caveman@caveman + mattpocock-skills@mattpocock memsearch@memsearch-plugins ) for entry in "${plugins[@]}"; do diff --git a/chezmoi/.chezmoitemplates/claude-settings.json b/chezmoi/.chezmoitemplates/claude-settings.json index f9fd2904..90d9665c 100644 --- a/chezmoi/.chezmoitemplates/claude-settings.json +++ b/chezmoi/.chezmoitemplates/claude-settings.json @@ -1,18 +1,18 @@ { "$schema": "https://json.schemastore.org/claude-code-settings.json", "model": "sonnet", - "fallbackModel": ["bedrock.claude-sonnet-4-5"], + "fallbackModel": ["bedrock.claude-sonnet-4-5[1m]"], "modelOverrides": { - "claude-haiku-4-5": "bedrock.claude-haiku-4-5", - "claude-sonnet-4-5": "bedrock.claude-sonnet-4-5", - "claude-sonnet-4-6": "bedrock.claude-sonnet-4-6", - "claude-sonnet-5": "bedrock.claude-sonnet-5", - "claude-opus-4-8": "bedrock.claude-opus-4-8" + "claude-haiku-4-5": "bedrock.claude-haiku-4-5[1m]", + "claude-sonnet-4-5": "bedrock.claude-sonnet-4-5[1m]", + "claude-sonnet-4-6": "bedrock.claude-sonnet-4-6[1m]", + "claude-sonnet-5": "bedrock.claude-sonnet-5[1m]", + "claude-opus-4-8": "bedrock.claude-opus-4-8[1m]" }, "env": { - "ANTHROPIC_DEFAULT_HAIKU_MODEL": "bedrock.claude-haiku-4-5", - "ANTHROPIC_DEFAULT_OPUS_MODEL": "bedrock.claude-opus-4-8", - "ANTHROPIC_DEFAULT_SONNET_MODEL": "bedrock.claude-sonnet-4-6" + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "bedrock.claude-haiku-4-5[1m]", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "bedrock.claude-opus-4-8[1m]", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "bedrock.claude-sonnet-4-6[1m]" }, "autoCompactEnabled": true, "awaySummaryEnabled": true, From b047ea74f8b09a1f957328692379892673539d8b Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Wed, 15 Jul 2026 11:30:54 +0800 Subject: [PATCH 5/5] refactor(okf): move scripts to hooks dir, add SessionStart hook, improve skill - Move maintenance script and prompt from scripts/ to hooks/ - Update hooks.json command paths to hooks/ - Add SessionStart hook alongside existing SessionEnd - Add completion criterion to maintain mode - Remove redundant conformance check from "Before declaring done" - Replace duplicated Step 5 bullets in prompt with pointer to maintain mode - Clean up resource placeholder in concept template Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../run_onchange_after_setup_claude.sh.tmpl | 1 - chezmoi/private_dot_claude/skills/okf/SKILL.md | 5 +++-- .../executable_okf-wiki-maintenance.sh | 0 .../private_dot_claude/skills/okf/hooks/hooks.json | 14 +++++++++++++- .../okf/{scripts => hooks}/okf-wiki-review.txt | 10 +--------- .../skills/okf/templates/concept.md | 2 +- 6 files changed, 18 insertions(+), 14 deletions(-) rename chezmoi/private_dot_claude/skills/okf/{scripts => hooks}/executable_okf-wiki-maintenance.sh (100%) rename chezmoi/private_dot_claude/skills/okf/{scripts => hooks}/okf-wiki-review.txt (66%) diff --git a/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl index 564d3695..5419ddaa 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_after_setup_claude.sh.tmpl @@ -20,7 +20,6 @@ done plugins=( claude-code-setup@claude-plugins-official claude-md-management@claude-plugins-official - commit-commands@claude-plugins-official gopls-lsp@claude-plugins-official pyright-lsp@claude-plugins-official typescript-lsp@claude-plugins-official diff --git a/chezmoi/private_dot_claude/skills/okf/SKILL.md b/chezmoi/private_dot_claude/skills/okf/SKILL.md index bf697233..eb6aa198 100644 --- a/chezmoi/private_dot_claude/skills/okf/SKILL.md +++ b/chezmoi/private_dot_claude/skills/okf/SKILL.md @@ -59,7 +59,9 @@ Templates: [concept](templates/concept.md), [index](templates/index.md), 1. Triage affected concepts by `resource`, path, or topic — cover every one. 2. Update body and `timestamp`; add or fix cross-links; create concepts for new assets; mark removed assets with `**Deprecation**` to preserve context. -3. Update `index.md` entries and append to `log.md`. +3. Update `index.md` entries and append to `log.md`. Done when every + triage-listed concept has an updated `timestamp`, `index.md` reflects all + changes, and `log.md` has an entry. ### consume — use a bundle as context @@ -70,6 +72,5 @@ Templates: [concept](templates/concept.md), [index](templates/index.md), ## Before declaring done -- Every concept written or touched: parseable frontmatter, non-empty `type`. - `index.md` updated for any new concepts. - `log.md` entry appended if the bundle has one. diff --git a/chezmoi/private_dot_claude/skills/okf/scripts/executable_okf-wiki-maintenance.sh b/chezmoi/private_dot_claude/skills/okf/hooks/executable_okf-wiki-maintenance.sh similarity index 100% rename from chezmoi/private_dot_claude/skills/okf/scripts/executable_okf-wiki-maintenance.sh rename to chezmoi/private_dot_claude/skills/okf/hooks/executable_okf-wiki-maintenance.sh diff --git a/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json b/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json index 8b1bcc3a..6650e909 100644 --- a/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json +++ b/chezmoi/private_dot_claude/skills/okf/hooks/hooks.json @@ -1,11 +1,23 @@ { "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/okf-wiki-maintenance.sh", + "async": true, + "timeout": 300 + } + ] + } + ], "SessionEnd": [ { "hooks": [ { "type": "command", - "command": "${CLAUDE_PLUGIN_ROOT}/scripts/okf-wiki-maintenance.sh", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/okf-wiki-maintenance.sh", "async": true, "timeout": 300 } diff --git a/chezmoi/private_dot_claude/skills/okf/scripts/okf-wiki-review.txt b/chezmoi/private_dot_claude/skills/okf/hooks/okf-wiki-review.txt similarity index 66% rename from chezmoi/private_dot_claude/skills/okf/scripts/okf-wiki-review.txt rename to chezmoi/private_dot_claude/skills/okf/hooks/okf-wiki-review.txt index 5f363e5c..5b3c78e8 100644 --- a/chezmoi/private_dot_claude/skills/okf/scripts/okf-wiki-review.txt +++ b/chezmoi/private_dot_claude/skills/okf/hooks/okf-wiki-review.txt @@ -17,15 +17,7 @@ A piece of knowledge is durable if it is likely to recur across future sessions covered by an existing concept. Skip one-off decisions, already-resolved issues, and project-transient status. If nothing qualifies, stop immediately — output nothing, make no changes. -Step 5 — if there is durable knowledge, apply the skill's "Maintaining a bundle" steps: -- Prefer amending an existing concept in place over creating a new one. -- Only create a new concept file for a genuinely new topic. -- Keep edits small and surgical. Do not rewrite unrelated sections of a file you are touching. -- Preserve existing content. Do not rewrite for style. -- Every concept file you write or touch must have YAML frontmatter with a non-empty `type` field. -- If you create a new concept file, link it from the nearest `index.md` and from any related - existing concepts. -- If a bundle-level `log.md` exists in the directory you are editing, add one line to it. +Step 5 — if there is durable knowledge, apply the skill's **maintain** mode. Constraints: - Do not touch memsearch-owned files (PROJECT.md, USER.md, memory .md files) — read-only to you. diff --git a/chezmoi/private_dot_claude/skills/okf/templates/concept.md b/chezmoi/private_dot_claude/skills/okf/templates/concept.md index 08f6f977..a1bc94f8 100644 --- a/chezmoi/private_dot_claude/skills/okf/templates/concept.md +++ b/chezmoi/private_dot_claude/skills/okf/templates/concept.md @@ -2,7 +2,7 @@ type: CONCEPT_TYPE title: DISPLAY_NAME description: Single sentence summarizing the concept. -resource: CANONICAL_URI_omit_for_abstract_concepts +# resource: URI # omit for abstract concepts tags: [TAG] timestamp: 2026-01-01T00:00:00Z ---