Skip to content
Back to skills

Forge Kb Init

ASecurity

Set up this project's knowledge base: survey it, ask a few skippable questions, propose a small core (AGENTS.md) with a map of topic files, a policy and a learning rule, and write it after approval. Never overwrites.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgobashnodegit

Works with

  • claude code
  • cursor
  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add JZO001/forge-agent-tree --skill forge-kb-init --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Forge Kb Init?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Forge Kb Init
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jzo001-forge-kb-init/badge)](https://www.skillsdirectory.com/skills/jzo001-forge-kb-init)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: forge-kb-init
description: "Set up this project's knowledge base: survey it, ask a few skippable questions, propose a small core (AGENTS.md) with a map of topic files, a policy and a learning rule, and write it after approval. Never overwrites."
argument-hint: "[write | answers or wishes]"
allowed-tools: Read, Grep, Glob, Bash(node:*), Edit(./AGENTS.md), Edit(./CLAUDE.md), Edit(./.claude/CLAUDE.md), Edit(./AI/**), Edit(./.gitignore)
---

# Knowledge base init

Set up the knowledge base of the project in the working directory: the instruction files Claude Code and other tools load, so that every future session starts with what the project needs and cannot get from its code. Its value is not a summary of the code, which describes itself and drifts from a copy. It is three things:
1. **The frame:** a small core (`AGENTS.md`) with a map of topic files, the rules for keeping it and the rule for learning; a `CLAUDE.md` that only imports the core; the policy (`AI/README.md`); topic files for the project's areas.
2. **What only people know:** what the project is for, the decisions and why, what not to do. It comes from the interview, never from guessing.
3. **A minimal project map:** only what is slow to find out: how to build, test and run it, the entry points, a short table of the top folders.

Arguments: `$ARGUMENTS`. `write` means the user approved the proposal you made earlier in this conversation: go straight to 4 and write it (if there is no proposal here, say so and start at 1). Other text is answers or wishes: use them, and do not ask them again.

The script, KB below: `node "${CLAUDE_SKILL_DIR}/../../scripts/kb.mjs"`. If that path does not exist, find `scripts/kb.mjs` of the forge-agent-tree plugin with Glob. Run no command but the script, and run it alone: nothing chained before or after it. The templates are in `${CLAUDE_SKILL_DIR}/templates/`; if reading them is refused, `KB init templates` prints them.

Without Node (the script is missing, or says Node is too old): go on without it. Survey by reading, copy each file you are about to change to `AI/.kb/backup-<YYYYMMDD-HHMMSS>/` first, and say at the end that the guard and the recorded state were left out.

## 1. Survey (read only)

Run `KB init survey .`. It gives the case (none, a CLAUDE.md alone, a core without a map, a knowledge base), the files Claude Code loads, the topic files, the policy, the learning rule, other tools' instruction files, the manifests, CI, documents and folders, the history's size and age, and what the frame lacks. Then read what it cannot judge: the manifests (for the build, test and run commands), the README, other tools' instruction files. Hand heavy reading to a subagent, so that only its summary comes back.

## 2. Interview

Ask in one message, numbered, each question skippable. Show the default of the closed ones, so that "the defaults" is an answer:
1. what the project is for, and for whom;
2. the language to talk to the user in (default: the one they write to you in), and the knowledge base's (default: English);
3. the important decisions so far, and why; what must not be done; what will not be built;
4. the way of working: commits and pushes, plans, reviews, the checks to run after a change;
5. conventions the code does not show;
6. whether the knowledge base should stay out of version control (default: no, it is shared in the repository, as nearly every project keeps it);
7. learning: writes on its own and logs it (the default), or proposes first.

For a project that has a knowledge base, ask only what the missing parts need. An answer becomes an entry: the rule or the fact, why, when, and who decided, as a role ("the user", "the team"), never a name.

## 3. Propose, then stop

Show the tree of files; for each file, its purpose and its trigger (when a task must read it); a draft of the core; the line for `.gitignore`: `AI/.kb/`, the tools' working folder, and nothing else. The knowledge base itself (`CLAUDE.md`, `AGENTS.md`, `AI/`) is shared and stays out of `.gitignore`, even where the project ignores part of it today (say so in the proposal instead); only a user who asked in the interview to keep it out of version control gets those lines. Ask whether the topic files are right. Write nothing yet: stop and wait for approval. Tell the user how to approve: run this skill again, as it was started, with `write`. This skill's permissions hold only in the turn it runs in: a plain "yes" works too, but then each write asks for permission.

## 4. After approval, write

1. `KB init begin .`: the backup. Note the stamp it prints.
2. Write the files:
   - **`AGENTS.md`, the core,** from its template: the introduction; "Knowledge base" (the map, "Always", the rules for keeping it, the rule for learning); the way of working and "won't do" from the interview; the minimal project map.
   - **`CLAUDE.md`:** the import only, from its template. Other `@` imports and `CLAUDE.local.md` stay where they are.
   - **`AI/README.md`:** the policy, with the learning setting filled in and the size limits' line kept (15 KB for the core, 25 KB for a topic file, unless the user asked for others).
   - **`AI/<topic>.md`:** the header from its template, and only the interview's answers and facts the code cannot tell. A topic file with nothing yet keeps its header and an empty section.
   - **`.gitignore`:** only the approved lines.
3. `KB init end . --since <stamp>`: the guard. If it names errors, fix them (a line that was there comes back from `AI/.kb/backup-<stamp>/`) and run it again, once. A part of the frame the user declined is not added: say so instead.
4. Tell the user briefly, in their language, what you wrote and where, and the core's size. Do not commit.

**The templates' rules:**
- Leave no `{{…}}` placeholder. A section with nothing to say is left out, except a topic file's first section.
- With no "Always" rule from the interview, leave out the "Always" list and the half-sentence about it in the rules for keeping. Start with at most three lines, only rules for every task.
- A knowledge base in another language than English is written in it, every file, the policy too; only the policy's size limits line stays as the template writes it, in English, because the tools read it.
- The core stays far below its size limit (the policy's line, 15 KB by default): every line in it is paid by every future session.

## 5. A project that has a knowledge base

- **Never overwrite.** No line that is there is replaced or removed: what you add goes beside it. A backup does not make an overwrite right; the guard checks it.
- **A `CLAUDE.md` that imports `AGENTS.md`** stays exactly as it is, notes and all.
- **A `CLAUDE.md` with content** (or a `.claude/CLAUDE.md`): move its text word for word into `AGENTS.md`, and make it the import.
- **An `AGENTS.md` that is there stays.** Propose only the parts of the frame the survey says it lacks: the rules for keeping and learning, beside what is there; the policy; the `.gitignore` line. No project map and no way of working: if the build or test commands are missing, say so in your report only.
  - **Without topic files yet,** the map is a table with the policy's row alone; the optimizer adds the topic files' rows under it when it splits the core. Write the rules as they will hold after the split: nothing about "until the split" or the core's own sections standing in for topic files, which turns false the moment it is made.
- **An `AI/README.md` that is there** is the project's own policy, and stays. Compare it with the template, name what it lacks (for example the learning rule), and propose only that, as a short addition in its voice. Never append the template.
- **Then hand over to the forge-kb-check skill:** it says whether the knowledge base needs splitting or tidying, and its report names the next step. That work is not the init's.
- **Other tools' instruction files** (Copilot, Cursor, Gemini): propose what is a project rule for `AGENTS.md`, naming its source. Do not delete them.

## 6. What the init does not do

- It writes no architecture essay, and nothing the code already says.
- It changes no code, and runs no build, test or check: what it writes is text.
- It does not commit, reads no other project, and does not write to the assistant's personal memory.

Files in this skill

  • SKILL.md8.1 KB
  • templates/AGENTS.template.md2.5 KB
  • templates/AI-README.template.md6 KB
  • templates/AI-topic.template.md315 B
  • templates/CLAUDE.template.md137 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.