first-tree 0.0.4 → 0.0.5
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.
- package/README.md +17 -8
- package/dist/cli.js +4 -4
- package/dist/{help-Dtdj91HJ.js → help-5-WG9QFm.js} +1 -1
- package/dist/{init--VepFe6N.js → init-CAq0Uhq6.js} +19 -7
- package/dist/{installer-cH7N4RNj.js → installer-UgNasLjl.js} +19 -15
- package/dist/onboarding-3zYUeYQb.js +2 -0
- package/dist/onboarding-Dd63N-V1.js +10 -0
- package/dist/{repo-DY57bMqr.js → repo-DkR12VUv.js} +55 -4
- package/dist/{upgrade-Cgx_K2HM.js → upgrade-DYzuvv1k.js} +13 -8
- package/dist/{verify-mC9ZTd1f.js → verify-C0IUSkMZ.js} +1 -1
- package/package.json +12 -10
- package/skills/first-tree/SKILL.md +10 -6
- package/skills/first-tree/assets/framework/VERSION +1 -1
- package/skills/first-tree/assets/framework/examples/claude-code/README.md +2 -2
- package/skills/first-tree/assets/framework/examples/claude-code/settings.json +1 -1
- package/skills/first-tree/assets/framework/helpers/generate-codeowners.ts +1 -1
- package/skills/first-tree/assets/framework/helpers/inject-tree-context.sh +0 -0
- package/skills/first-tree/assets/framework/helpers/run-review.ts +1 -1
- package/skills/first-tree/assets/framework/templates/agents.md.template +2 -2
- package/skills/first-tree/assets/framework/templates/members-domain.md.template +1 -1
- package/skills/first-tree/assets/framework/templates/root-node.md.template +3 -3
- package/skills/first-tree/assets/framework/workflows/codeowners.yml +1 -1
- package/skills/first-tree/assets/framework/workflows/pr-review.yml +1 -1
- package/skills/first-tree/engine/init.ts +3 -2
- package/skills/first-tree/engine/repo.ts +36 -3
- package/skills/first-tree/engine/rules/agent-integration.ts +3 -1
- package/skills/first-tree/engine/rules/framework.ts +2 -2
- package/skills/first-tree/engine/runtime/adapters.ts +6 -2
- package/skills/first-tree/engine/runtime/asset-loader.ts +136 -4
- package/skills/first-tree/engine/runtime/installer.ts +18 -12
- package/skills/first-tree/engine/upgrade.ts +35 -8
- package/skills/first-tree/references/onboarding.md +28 -18
- package/skills/first-tree/references/upgrade-contract.md +49 -23
- package/skills/first-tree/scripts/check-skill-sync.sh +0 -0
- package/skills/first-tree/scripts/quick_validate.py +0 -0
- package/skills/first-tree/scripts/run-local-cli.sh +0 -0
- package/skills/first-tree/tests/asset-loader.test.ts +23 -1
- package/skills/first-tree/tests/helpers.ts +27 -3
- package/skills/first-tree/tests/init.test.ts +11 -3
- package/skills/first-tree/tests/repo.test.ts +26 -0
- package/skills/first-tree/tests/rules.test.ts +9 -7
- package/skills/first-tree/tests/skill-artifacts.test.ts +6 -0
- package/skills/first-tree/tests/upgrade.test.ts +20 -1
- package/skills/first-tree/tests/verify.test.ts +3 -3
- package/dist/onboarding-C9cYSE6F.js +0 -2
- package/dist/onboarding-CPP8fF4D.js +0 -10
package/README.md
CHANGED
|
@@ -52,9 +52,10 @@ git init
|
|
|
52
52
|
context-tree init --here
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
- `context-tree init` installs
|
|
56
|
-
`
|
|
57
|
-
`
|
|
55
|
+
- `context-tree init` installs `.agents/skills/first-tree/` and
|
|
56
|
+
`.claude/skills/first-tree/`, creates `NODE.md`, `AGENTS.md`,
|
|
57
|
+
`members/NODE.md`, and writes a checklist to
|
|
58
|
+
`.agents/skills/first-tree/progress.md`.
|
|
58
59
|
- `context-tree verify` checks both the progress checklist and deterministic
|
|
59
60
|
tree validation. It is expected to fail until the required onboarding tasks
|
|
60
61
|
are complete.
|
|
@@ -79,11 +80,17 @@ runtime.
|
|
|
79
80
|
|
|
80
81
|
## Package Name vs Command
|
|
81
82
|
|
|
82
|
-
- npm package
|
|
83
|
-
- installed CLI command
|
|
84
|
-
- installed skill
|
|
85
|
-
-
|
|
86
|
-
|
|
83
|
+
- The npm package is `first-tree`.
|
|
84
|
+
- The installed CLI command is `context-tree`.
|
|
85
|
+
- The installed skill directories inside a user tree are
|
|
86
|
+
`.agents/skills/first-tree/` and `.claude/skills/first-tree/`.
|
|
87
|
+
- The published package keeps its bundled canonical source under
|
|
88
|
+
`skills/first-tree/`.
|
|
89
|
+
- When maintainer docs say "the `first-tree` skill", they mean that bundled
|
|
90
|
+
skill directory, not the npm package name.
|
|
91
|
+
- `npx first-tree init` is the quickest one-off entrypoint.
|
|
92
|
+
- `npm install -g first-tree` adds `context-tree` to your PATH for repeated
|
|
93
|
+
use.
|
|
87
94
|
|
|
88
95
|
## Runtime And Maintainer Prerequisites
|
|
89
96
|
|
|
@@ -97,6 +104,8 @@ runtime.
|
|
|
97
104
|
bundled skill.
|
|
98
105
|
- `skills/first-tree/` is the canonical source for framework behavior, shipped
|
|
99
106
|
templates, maintainer references, and validation logic.
|
|
107
|
+
- `context-tree init` installs that bundled skill into `.agents/skills/first-tree/`
|
|
108
|
+
and `.claude/skills/first-tree/` inside user repos.
|
|
100
109
|
- `evals/` is maintainer-only developer tooling for the source repo. It is
|
|
101
110
|
intentionally not part of the published package.
|
|
102
111
|
|
package/dist/cli.js
CHANGED
|
@@ -44,18 +44,18 @@ async function runCli(args, output = console.log) {
|
|
|
44
44
|
const command = args[0];
|
|
45
45
|
switch (command) {
|
|
46
46
|
case "init": {
|
|
47
|
-
const { runInit } = await import("./init
|
|
47
|
+
const { runInit } = await import("./init-CAq0Uhq6.js");
|
|
48
48
|
return runInit(args.slice(1));
|
|
49
49
|
}
|
|
50
50
|
case "verify": {
|
|
51
|
-
const { runVerify } = await import("./verify-
|
|
51
|
+
const { runVerify } = await import("./verify-C0IUSkMZ.js");
|
|
52
52
|
return runVerify(args.slice(1));
|
|
53
53
|
}
|
|
54
54
|
case "upgrade": {
|
|
55
|
-
const { runUpgrade } = await import("./upgrade-
|
|
55
|
+
const { runUpgrade } = await import("./upgrade-DYzuvv1k.js");
|
|
56
56
|
return runUpgrade(args.slice(1));
|
|
57
57
|
}
|
|
58
|
-
case "help": return (await import("./help-
|
|
58
|
+
case "help": return (await import("./help-5-WG9QFm.js")).runHelp(args.slice(1), write);
|
|
59
59
|
default:
|
|
60
60
|
write(`Unknown command: ${command}`);
|
|
61
61
|
write(USAGE);
|
|
@@ -12,7 +12,7 @@ async function runHelp(args, output = console.log) {
|
|
|
12
12
|
}
|
|
13
13
|
switch (topic) {
|
|
14
14
|
case "onboarding": {
|
|
15
|
-
const { runOnboarding } = await import("./onboarding-
|
|
15
|
+
const { runOnboarding } = await import("./onboarding-3zYUeYQb.js");
|
|
16
16
|
return runOnboarding(output);
|
|
17
17
|
}
|
|
18
18
|
default:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as onboarding_default } from "./onboarding-
|
|
3
|
-
import { n as renderTemplateFile, r as resolveBundledPackageRoot, t as copyCanonicalSkill } from "./installer-
|
|
1
|
+
import { T as installedSkillRootsDisplay, b as LEGACY_SKILL_EXAMPLES_DIR, c as FRAMEWORK_ASSET_ROOT, d as FRAMEWORK_VERSION, f as FRAMEWORK_WORKFLOWS_DIR, g as LEGACY_EXAMPLES_DIR, h as LEGACY_AGENT_INSTRUCTIONS_FILE, i as AGENT_INSTRUCTIONS_TEMPLATE, l as FRAMEWORK_EXAMPLES_DIR, n as Repo, o as CLAUDE_FRAMEWORK_EXAMPLES_DIR, p as INSTALLED_PROGRESS, r as AGENT_INSTRUCTIONS_FILE, t as FRAMEWORK_END_MARKER, u as FRAMEWORK_TEMPLATES_DIR, v as LEGACY_REPO_SKILL_EXAMPLES_DIR } from "./repo-DkR12VUv.js";
|
|
2
|
+
import { n as onboarding_default } from "./onboarding-Dd63N-V1.js";
|
|
3
|
+
import { n as renderTemplateFile, r as resolveBundledPackageRoot, t as copyCanonicalSkill } from "./installer-UgNasLjl.js";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { execFileSync } from "node:child_process";
|
|
6
6
|
import { dirname, join, relative, resolve } from "node:path";
|
|
@@ -47,12 +47,24 @@ function evaluate$6(repo) {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
|
+
//#region skills/first-tree/engine/runtime/adapters.ts
|
|
51
|
+
function claudeCodeExampleCandidates() {
|
|
52
|
+
return [
|
|
53
|
+
join(CLAUDE_FRAMEWORK_EXAMPLES_DIR, "claude-code"),
|
|
54
|
+
join(FRAMEWORK_EXAMPLES_DIR, "claude-code"),
|
|
55
|
+
join(LEGACY_REPO_SKILL_EXAMPLES_DIR, "claude-code"),
|
|
56
|
+
join(LEGACY_SKILL_EXAMPLES_DIR, "claude-code"),
|
|
57
|
+
join(LEGACY_EXAMPLES_DIR, "claude-code")
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
50
61
|
//#region skills/first-tree/engine/rules/agent-integration.ts
|
|
51
62
|
var agent_integration_exports = /* @__PURE__ */ __exportAll({ evaluate: () => evaluate$5 });
|
|
52
63
|
function evaluate$5(repo) {
|
|
53
64
|
const tasks = [];
|
|
65
|
+
const [claudeExamplePath] = claudeCodeExampleCandidates();
|
|
54
66
|
if (repo.pathExists(".claude/settings.json")) {
|
|
55
|
-
if (!repo.fileContains(".claude/settings.json", "inject-tree-context")) tasks.push(`Add SessionStart hook to \`.claude/settings.json\` (see \`${
|
|
67
|
+
if (!repo.fileContains(".claude/settings.json", "inject-tree-context")) tasks.push(`Add SessionStart hook to \`.claude/settings.json\` (see \`${claudeExamplePath}/\`)`);
|
|
56
68
|
} else if (!repo.anyAgentConfig()) tasks.push(`No agent configuration detected. Configure your agent to load tree context at session start. See \`${FRAMEWORK_EXAMPLES_DIR}/\` for supported agents. You can skip this and set it up later.`);
|
|
57
69
|
return {
|
|
58
70
|
group: "Agent Integration",
|
|
@@ -106,7 +118,7 @@ If (1): ask the user to provide the key, then run \`gh secret set\` with the sec
|
|
|
106
118
|
var framework_exports = /* @__PURE__ */ __exportAll({ evaluate: () => evaluate$3 });
|
|
107
119
|
function evaluate$3(repo) {
|
|
108
120
|
const tasks = [];
|
|
109
|
-
if (!repo.hasFramework()) tasks.push(
|
|
121
|
+
if (!repo.hasFramework()) tasks.push(`${installedSkillRootsDisplay()} not found — run \`context-tree init\` to install the framework skill bundled with the current \`first-tree\` package`);
|
|
110
122
|
return {
|
|
111
123
|
group: "Framework",
|
|
112
124
|
order: 1,
|
|
@@ -219,7 +231,7 @@ const TEMPLATE_MAP = [
|
|
|
219
231
|
];
|
|
220
232
|
function installSkill(source, target) {
|
|
221
233
|
copyCanonicalSkill(source, target);
|
|
222
|
-
console.log(
|
|
234
|
+
console.log(` Installed ${installedSkillRootsDisplay()} from the bundled first-tree package`);
|
|
223
235
|
}
|
|
224
236
|
function renderTemplates(target) {
|
|
225
237
|
const frameworkDir = join(target, FRAMEWORK_ASSET_ROOT);
|
|
@@ -280,7 +292,7 @@ function runInit(repo, options) {
|
|
|
280
292
|
if (initTarget.createdGitRepo) console.log(" Initialized a new git repo for the tree.");
|
|
281
293
|
console.log();
|
|
282
294
|
}
|
|
283
|
-
if (!r.
|
|
295
|
+
if (!r.hasCurrentInstalledSkill()) try {
|
|
284
296
|
const sourceRoot = options?.sourceRoot ?? resolveBundledPackageRoot();
|
|
285
297
|
console.log("Installing the framework skill bundled with this first-tree package...");
|
|
286
298
|
console.log("Installing skill and scaffolding...");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as LEGACY_SKILL_ROOT, a as BUNDLED_SKILL_ROOT, m as INSTALLED_SKILL_ROOTS, y as LEGACY_REPO_SKILL_ROOT } from "./repo-DkR12VUv.js";
|
|
2
2
|
import { copyFileSync, cpSync, existsSync, mkdirSync, rmSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
@@ -6,7 +6,7 @@ import { dirname, join } from "node:path";
|
|
|
6
6
|
function resolveBundledPackageRoot(startUrl = import.meta.url) {
|
|
7
7
|
let dir = dirname(fileURLToPath(startUrl));
|
|
8
8
|
while (true) {
|
|
9
|
-
if (existsSync(join(dir, "package.json")) && existsSync(join(dir,
|
|
9
|
+
if (existsSync(join(dir, "package.json")) && existsSync(join(dir, BUNDLED_SKILL_ROOT, "SKILL.md"))) return dir;
|
|
10
10
|
const parent = dirname(dir);
|
|
11
11
|
if (parent === dir) break;
|
|
12
12
|
dir = parent;
|
|
@@ -16,24 +16,28 @@ function resolveBundledPackageRoot(startUrl = import.meta.url) {
|
|
|
16
16
|
function resolveCanonicalSkillRoot(sourceRoot) {
|
|
17
17
|
const directSkillRoot = sourceRoot;
|
|
18
18
|
if (existsSync(join(directSkillRoot, "SKILL.md")) && existsSync(join(directSkillRoot, "assets", "framework", "VERSION"))) return directSkillRoot;
|
|
19
|
-
const nestedSkillRoot = join(sourceRoot,
|
|
19
|
+
const nestedSkillRoot = join(sourceRoot, BUNDLED_SKILL_ROOT);
|
|
20
20
|
if (existsSync(join(nestedSkillRoot, "SKILL.md")) && existsSync(join(nestedSkillRoot, "assets", "framework", "VERSION"))) return nestedSkillRoot;
|
|
21
21
|
throw new Error(`Canonical skill not found under ${sourceRoot}. Reinstall the \`first-tree\` package and try again.`);
|
|
22
22
|
}
|
|
23
23
|
function copyCanonicalSkill(sourceRoot, targetRoot) {
|
|
24
24
|
const src = resolveCanonicalSkillRoot(sourceRoot);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
for (const relPath of [
|
|
26
|
+
...INSTALLED_SKILL_ROOTS,
|
|
27
|
+
LEGACY_REPO_SKILL_ROOT,
|
|
28
|
+
LEGACY_SKILL_ROOT
|
|
29
|
+
]) {
|
|
30
|
+
const fullPath = join(targetRoot, relPath);
|
|
31
|
+
if (existsSync(fullPath)) rmSync(fullPath, {
|
|
32
|
+
recursive: true,
|
|
33
|
+
force: true
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
for (const relPath of INSTALLED_SKILL_ROOTS) {
|
|
37
|
+
const dst = join(targetRoot, relPath);
|
|
38
|
+
mkdirSync(dirname(dst), { recursive: true });
|
|
39
|
+
cpSync(src, dst, { recursive: true });
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
function renderTemplateFile(frameworkRoot, templateName, targetRoot, targetPath) {
|
|
39
43
|
const src = join(frameworkRoot, "templates", templateName);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region skills/first-tree/references/onboarding.md
|
|
2
|
+
var onboarding_default = "# Context Tree Onboarding\n\nYou are setting up a **Context Tree** — the living source of truth for an organization. This document tells you what it is and how to bootstrap one.\n\n---\n\n## What Is a Context Tree\n\nA Context Tree is a Git repository where every directory is a **domain** and every file is a **node**. Each node captures decisions, designs, and cross-domain relationships — the knowledge that would otherwise scatter across PRs, documents, and people's heads.\n\nKey properties:\n\n- **Nodes are markdown files.** Each directory has a `NODE.md` that describes the domain. Leaf `.md` files capture specific decisions or designs.\n- **Every node has an owner.** Declared in YAML frontmatter. Owners approve changes to their nodes.\n- **Organized by concern, not by repo or team.** An agent working on \"add SSO\" finds all auth context in one place — not split across 4 repos.\n- **The tree is never a snapshot — it's the current state.** When decisions change, the tree updates. Stale nodes are bugs.\n\n### Frontmatter Format\n\nEvery node has frontmatter:\n\n```yaml\n---\ntitle: \"Auth Architecture\"\nowners: [alice, bob]\nsoft_links: [/infrastructure/deployments]\n---\n```\n\n- `owners` — who can approve changes. `owners: []` inherits from parent. `owners: [*]` means anyone.\n- `soft_links` — cross-references to related nodes in other domains.\n\n### What Belongs in the Tree\n\nInformation an agent needs to **decide** on an approach — not to execute it.\n\n**Yes:** \"Auth spans 4 repos: backend issues JWTs, frontend uses Better Auth, extension uses OAuth popup, desktop uses localhost callback.\"\n\n**No:** The function signature of `auth_service.verify()` — that's in the code.\n\n---\n\n## Four Principles\n\n1. **Source of truth for decisions, not execution.** The tree captures the *what* and *why*. Execution details stay in source systems.\n2. **Agents are first-class participants.** The tree is designed for agents to navigate and update.\n3. **Transparency by default.** Reading is open to all. Writing requires owner approval.\n4. **Git-native.** Nodes are files, domains are directories. History, ownership, and review follow Git conventions.\n\n---\n\n## How to Set Up a Context Tree\n\n### Prerequisites\n\n- A source/workspace Git repository, or an already-created dedicated tree repo\n- Node.js 18+\n- The npm package is `first-tree`, the installed CLI command is\n `context-tree`.\n- `context-tree init` installs the framework skill into\n `.agents/skills/first-tree/` and `.claude/skills/first-tree/`.\n- Use `npx first-tree init` for one-off runs, or `npm install -g first-tree`\n to add the `context-tree` command to your PATH\n\n### Step 1: Initialize\n\nRecommended workflow: run `context-tree init` from your source or workspace repo.\nThe CLI will create a sibling dedicated tree repo named `<repo>-context` by\ndefault and install the framework there.\n\n```bash\ncd my-org\ncontext-tree init\ncd ../my-org-context\n```\n\nIf you already created a dedicated tree repo manually, initialize it in place:\n\n```bash\nmkdir my-org-context && cd my-org-context\ngit init\ncontext-tree init --here\n```\n\nEither way, the framework installs into `.agents/skills/first-tree/` and\n`.claude/skills/first-tree/`, renders scaffolding (`NODE.md`, `AGENTS.md`,\n`members/NODE.md`), and generates a task list in\n`.agents/skills/first-tree/progress.md`.\n\nPublishing tip: keep the tree repo in the same GitHub organization as the\nsource repo unless you have a reason not to.\n\n### Step 2: Work Through the Task List\n\nRead `.agents/skills/first-tree/progress.md`. It contains a checklist tailored\nto the current state of the repo. Complete each task:\n\n- Fill in `NODE.md` with your organization name, owners, and domains\n- Add project-specific instructions to `AGENTS.md` below the framework markers\n- Create member nodes under `members/`\n- Optionally configure agent integration (for Claude Code, the installed hook\n assets live under `.claude/skills/first-tree/`)\n- Copy validation workflows from\n `.agents/skills/first-tree/assets/framework/workflows/` to\n `.github/workflows/`\n\nAs you complete each task, check it off in\n`.agents/skills/first-tree/progress.md` by changing `- [ ]` to `- [x]`.\n\n### Step 3: Verify\n\n```bash\ncontext-tree verify\n```\n\nOr, from your source/workspace repo:\n\n```bash\ncontext-tree verify --tree-path ../my-org-context\n```\n\nThis fails if any items in `.agents/skills/first-tree/progress.md` remain\nunchecked, and runs deterministic checks (valid frontmatter, node structure,\nmember nodes exist).\n\n### Step 4: Design Your Domains\n\nCreate top-level directories for your organization's primary concerns. Each needs a `NODE.md`:\n\n```\nmy-org-tree/\n NODE.md # root — lists all domains\n engineering/\n NODE.md # decisions about architecture, infra, tooling\n product/\n NODE.md # strategy, roadmap, user research\n marketing/\n NODE.md # positioning, campaigns\n members/\n NODE.md # team members and agents\n alice/\n NODE.md # individual member node\n```\n\n### Step 5: Populate from Existing Work\n\nFor each domain, extract knowledge from existing repos, docs, and systems:\n\n- Decisions and their rationale\n- Cross-domain relationships and dependencies\n- Constraints that aren't obvious from the code\n\nThe tree doesn't duplicate source code — it captures what connects things and why they were built that way.\n\n---\n\n## CLI Reference\n\n| Command | Description |\n|---------|-------------|\n| `context-tree init` | Create or refresh a dedicated tree repo. By default, running in a source/workspace repo creates a sibling `<repo>-context`; use `--here` to initialize the current repo in place. |\n| `context-tree verify` | Check the installed progress file for unchecked items + run deterministic validation. Use `--tree-path` when invoking from another working directory. |\n| `context-tree upgrade` | Refresh the installed framework skill from the currently running `first-tree` npm package and generate follow-up tasks. Use `--tree-path` when invoking from another working directory. |\n| `context-tree help onboarding` | Print this onboarding guide. |\n\n---\n\n## Upgrading the Framework\n\nWhen the framework updates:\n\n```bash\ncontext-tree upgrade\n```\n\n`context-tree upgrade` refreshes `.agents/skills/first-tree/` and\n`.claude/skills/first-tree/` from the skill bundled with the currently running\n`first-tree` npm package, preserves your tree content, and generates follow-up\ntasks in `.agents/skills/first-tree/progress.md`.\n\nIf your repo still uses the older `skills/first-tree/`,\n`skills/first-tree-cli-framework/`, or `.context-tree/` layouts,\n`context-tree upgrade` will migrate it to the current installed layout first.\n\nTo pick up a newer framework release, first run a newer package version, for\nexample `npx first-tree@latest upgrade`, or update your global `first-tree`\ninstall before running `context-tree upgrade`.\n\n---\n\n## Further Reading\n\n- `.agents/skills/first-tree/references/principles.md` — Core principles with detailed examples\n- `.agents/skills/first-tree/references/ownership-and-naming.md` — How nodes are named and owned\n- `AGENTS.md` in your tree — The before/during/after workflow for every task\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region skills/first-tree/engine/onboarding.ts
|
|
5
|
+
function runOnboarding(output = console.log) {
|
|
6
|
+
output(onboarding_default);
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { onboarding_default as n, runOnboarding as t };
|
|
@@ -2,7 +2,10 @@ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
|
2
2
|
import { basename, dirname, join, resolve } from "node:path";
|
|
3
3
|
//#region skills/first-tree/engine/runtime/asset-loader.ts
|
|
4
4
|
const SKILL_NAME = "first-tree";
|
|
5
|
-
const
|
|
5
|
+
const BUNDLED_SKILL_ROOT = join("skills", SKILL_NAME);
|
|
6
|
+
const SKILL_ROOT = join(".agents", "skills", SKILL_NAME);
|
|
7
|
+
const CLAUDE_SKILL_ROOT = join(".claude", "skills", SKILL_NAME);
|
|
8
|
+
const INSTALLED_SKILL_ROOTS = [SKILL_ROOT, CLAUDE_SKILL_ROOT];
|
|
6
9
|
join(SKILL_ROOT, "agents");
|
|
7
10
|
join(SKILL_ROOT, "references");
|
|
8
11
|
const FRAMEWORK_ASSET_ROOT = join(SKILL_ROOT, "assets", "framework");
|
|
@@ -17,6 +20,29 @@ const INSTALLED_PROGRESS = join(SKILL_ROOT, "progress.md");
|
|
|
17
20
|
const AGENT_INSTRUCTIONS_FILE = "AGENTS.md";
|
|
18
21
|
const LEGACY_AGENT_INSTRUCTIONS_FILE = "AGENT.md";
|
|
19
22
|
const AGENT_INSTRUCTIONS_TEMPLATE = "agents.md.template";
|
|
23
|
+
join(CLAUDE_SKILL_ROOT, "agents");
|
|
24
|
+
join(CLAUDE_SKILL_ROOT, "references");
|
|
25
|
+
const CLAUDE_FRAMEWORK_ASSET_ROOT = join(CLAUDE_SKILL_ROOT, "assets", "framework");
|
|
26
|
+
join(CLAUDE_FRAMEWORK_ASSET_ROOT, "manifest.json");
|
|
27
|
+
const CLAUDE_FRAMEWORK_VERSION = join(CLAUDE_FRAMEWORK_ASSET_ROOT, "VERSION");
|
|
28
|
+
join(CLAUDE_FRAMEWORK_ASSET_ROOT, "templates");
|
|
29
|
+
join(CLAUDE_FRAMEWORK_ASSET_ROOT, "workflows");
|
|
30
|
+
join(CLAUDE_FRAMEWORK_ASSET_ROOT, "prompts");
|
|
31
|
+
const CLAUDE_FRAMEWORK_EXAMPLES_DIR = join(CLAUDE_FRAMEWORK_ASSET_ROOT, "examples");
|
|
32
|
+
join(CLAUDE_FRAMEWORK_ASSET_ROOT, "helpers");
|
|
33
|
+
const CLAUDE_INSTALLED_PROGRESS = join(CLAUDE_SKILL_ROOT, "progress.md");
|
|
34
|
+
const LEGACY_REPO_SKILL_ROOT = join("skills", SKILL_NAME);
|
|
35
|
+
join(LEGACY_REPO_SKILL_ROOT, "agents");
|
|
36
|
+
join(LEGACY_REPO_SKILL_ROOT, "references");
|
|
37
|
+
const LEGACY_REPO_SKILL_ASSET_ROOT = join(LEGACY_REPO_SKILL_ROOT, "assets", "framework");
|
|
38
|
+
join(LEGACY_REPO_SKILL_ASSET_ROOT, "manifest.json");
|
|
39
|
+
const LEGACY_REPO_SKILL_VERSION = join(LEGACY_REPO_SKILL_ASSET_ROOT, "VERSION");
|
|
40
|
+
join(LEGACY_REPO_SKILL_ASSET_ROOT, "templates");
|
|
41
|
+
join(LEGACY_REPO_SKILL_ASSET_ROOT, "workflows");
|
|
42
|
+
join(LEGACY_REPO_SKILL_ASSET_ROOT, "prompts");
|
|
43
|
+
const LEGACY_REPO_SKILL_EXAMPLES_DIR = join(LEGACY_REPO_SKILL_ASSET_ROOT, "examples");
|
|
44
|
+
join(LEGACY_REPO_SKILL_ASSET_ROOT, "helpers");
|
|
45
|
+
const LEGACY_REPO_SKILL_PROGRESS = join(LEGACY_REPO_SKILL_ROOT, "progress.md");
|
|
20
46
|
const LEGACY_SKILL_NAME = "first-tree-cli-framework";
|
|
21
47
|
const LEGACY_SKILL_ROOT = join("skills", LEGACY_SKILL_NAME);
|
|
22
48
|
const LEGACY_SKILL_ASSET_ROOT = join(LEGACY_SKILL_ROOT, "assets", "framework");
|
|
@@ -24,7 +50,7 @@ const LEGACY_SKILL_VERSION = join(LEGACY_SKILL_ASSET_ROOT, "VERSION");
|
|
|
24
50
|
join(LEGACY_SKILL_ASSET_ROOT, "templates");
|
|
25
51
|
join(LEGACY_SKILL_ASSET_ROOT, "workflows");
|
|
26
52
|
join(LEGACY_SKILL_ASSET_ROOT, "prompts");
|
|
27
|
-
join(LEGACY_SKILL_ASSET_ROOT, "examples");
|
|
53
|
+
const LEGACY_SKILL_EXAMPLES_DIR = join(LEGACY_SKILL_ASSET_ROOT, "examples");
|
|
28
54
|
const LEGACY_SKILL_PROGRESS = join(LEGACY_SKILL_ROOT, "progress.md");
|
|
29
55
|
const LEGACY_FRAMEWORK_ROOT = ".context-tree";
|
|
30
56
|
const LEGACY_VERSION = join(LEGACY_FRAMEWORK_ROOT, "VERSION");
|
|
@@ -32,7 +58,7 @@ const LEGACY_PROGRESS = join(LEGACY_FRAMEWORK_ROOT, "progress.md");
|
|
|
32
58
|
join(LEGACY_FRAMEWORK_ROOT, "templates");
|
|
33
59
|
join(LEGACY_FRAMEWORK_ROOT, "workflows");
|
|
34
60
|
join(LEGACY_FRAMEWORK_ROOT, "prompts");
|
|
35
|
-
join(LEGACY_FRAMEWORK_ROOT, "examples");
|
|
61
|
+
const LEGACY_EXAMPLES_DIR = join(LEGACY_FRAMEWORK_ROOT, "examples");
|
|
36
62
|
function pathExists(root, relPath) {
|
|
37
63
|
const fullPath = join(root, relPath);
|
|
38
64
|
try {
|
|
@@ -41,9 +67,17 @@ function pathExists(root, relPath) {
|
|
|
41
67
|
return false;
|
|
42
68
|
}
|
|
43
69
|
}
|
|
70
|
+
function installedSkillRoots() {
|
|
71
|
+
return [...INSTALLED_SKILL_ROOTS];
|
|
72
|
+
}
|
|
73
|
+
function installedSkillRootsDisplay() {
|
|
74
|
+
return installedSkillRoots().map((root) => `\`${root}/\``).join(" and ");
|
|
75
|
+
}
|
|
44
76
|
function frameworkVersionCandidates() {
|
|
45
77
|
return [
|
|
46
78
|
FRAMEWORK_VERSION,
|
|
79
|
+
CLAUDE_FRAMEWORK_VERSION,
|
|
80
|
+
LEGACY_REPO_SKILL_VERSION,
|
|
47
81
|
LEGACY_SKILL_VERSION,
|
|
48
82
|
LEGACY_VERSION
|
|
49
83
|
];
|
|
@@ -51,6 +85,8 @@ function frameworkVersionCandidates() {
|
|
|
51
85
|
function progressFileCandidates() {
|
|
52
86
|
return [
|
|
53
87
|
INSTALLED_PROGRESS,
|
|
88
|
+
CLAUDE_INSTALLED_PROGRESS,
|
|
89
|
+
LEGACY_REPO_SKILL_PROGRESS,
|
|
54
90
|
LEGACY_SKILL_PROGRESS,
|
|
55
91
|
LEGACY_PROGRESS
|
|
56
92
|
];
|
|
@@ -64,6 +100,8 @@ function resolveFirstExistingPath(root, candidates) {
|
|
|
64
100
|
}
|
|
65
101
|
function detectFrameworkLayout(root) {
|
|
66
102
|
if (pathExists(root, FRAMEWORK_VERSION)) return "skill";
|
|
103
|
+
if (pathExists(root, CLAUDE_FRAMEWORK_VERSION)) return "claude-skill";
|
|
104
|
+
if (pathExists(root, LEGACY_REPO_SKILL_VERSION)) return "legacy-repo-skill";
|
|
67
105
|
if (pathExists(root, LEGACY_SKILL_VERSION)) return "legacy-skill";
|
|
68
106
|
if (pathExists(root, LEGACY_VERSION)) return "legacy";
|
|
69
107
|
return null;
|
|
@@ -188,6 +226,15 @@ var Repo = class {
|
|
|
188
226
|
anyAgentConfig() {
|
|
189
227
|
return [".claude/settings.json", ".codex/config.json"].some((c) => this.pathExists(c));
|
|
190
228
|
}
|
|
229
|
+
installedSkillRoots() {
|
|
230
|
+
return installedSkillRoots();
|
|
231
|
+
}
|
|
232
|
+
missingInstalledSkillRoots() {
|
|
233
|
+
return this.installedSkillRoots().filter((root) => !this.pathExists(join(root, "SKILL.md")) || !this.pathExists(join(root, "assets", "framework", "VERSION")));
|
|
234
|
+
}
|
|
235
|
+
hasCurrentInstalledSkill() {
|
|
236
|
+
return this.missingInstalledSkillRoots().length === 0;
|
|
237
|
+
}
|
|
191
238
|
isGitRepo() {
|
|
192
239
|
return hasGitMetadata(this.root);
|
|
193
240
|
}
|
|
@@ -210,12 +257,16 @@ var Repo = class {
|
|
|
210
257
|
const layout = this.frameworkLayout();
|
|
211
258
|
if (layout === "legacy") return LEGACY_PROGRESS;
|
|
212
259
|
if (layout === "legacy-skill") return LEGACY_SKILL_PROGRESS;
|
|
260
|
+
if (layout === "legacy-repo-skill") return LEGACY_REPO_SKILL_PROGRESS;
|
|
261
|
+
if (layout === "claude-skill") return CLAUDE_INSTALLED_PROGRESS;
|
|
213
262
|
return INSTALLED_PROGRESS;
|
|
214
263
|
}
|
|
215
264
|
frameworkVersionPath() {
|
|
216
265
|
const layout = this.frameworkLayout();
|
|
217
266
|
if (layout === "legacy") return LEGACY_VERSION;
|
|
218
267
|
if (layout === "legacy-skill") return LEGACY_SKILL_VERSION;
|
|
268
|
+
if (layout === "legacy-repo-skill") return LEGACY_REPO_SKILL_VERSION;
|
|
269
|
+
if (layout === "claude-skill") return CLAUDE_FRAMEWORK_VERSION;
|
|
219
270
|
return FRAMEWORK_VERSION;
|
|
220
271
|
}
|
|
221
272
|
agentInstructionsPath() {
|
|
@@ -315,4 +366,4 @@ function isDirectory(root, relPath) {
|
|
|
315
366
|
}
|
|
316
367
|
}
|
|
317
368
|
//#endregion
|
|
318
|
-
export {
|
|
369
|
+
export { SKILL_NAME as C, LEGACY_SKILL_ROOT as S, installedSkillRootsDisplay as T, LEGACY_FRAMEWORK_ROOT as _, BUNDLED_SKILL_ROOT as a, LEGACY_SKILL_EXAMPLES_DIR as b, FRAMEWORK_ASSET_ROOT as c, FRAMEWORK_VERSION as d, FRAMEWORK_WORKFLOWS_DIR as f, LEGACY_EXAMPLES_DIR as g, LEGACY_AGENT_INSTRUCTIONS_FILE as h, AGENT_INSTRUCTIONS_TEMPLATE as i, FRAMEWORK_EXAMPLES_DIR as l, INSTALLED_SKILL_ROOTS as m, Repo as n, CLAUDE_FRAMEWORK_EXAMPLES_DIR as o, INSTALLED_PROGRESS as p, AGENT_INSTRUCTIONS_FILE as r, CLAUDE_SKILL_ROOT as s, FRAMEWORK_END_MARKER as t, FRAMEWORK_TEMPLATES_DIR as u, LEGACY_REPO_SKILL_EXAMPLES_DIR as v, SKILL_ROOT as w, LEGACY_SKILL_NAME as x, LEGACY_REPO_SKILL_ROOT as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as resolveCanonicalSkillRoot, r as resolveBundledPackageRoot, t as copyCanonicalSkill } from "./installer-
|
|
1
|
+
import { S as LEGACY_SKILL_ROOT, T as installedSkillRootsDisplay, _ as LEGACY_FRAMEWORK_ROOT, d as FRAMEWORK_VERSION, f as FRAMEWORK_WORKFLOWS_DIR, h as LEGACY_AGENT_INSTRUCTIONS_FILE, i as AGENT_INSTRUCTIONS_TEMPLATE, n as Repo, p as INSTALLED_PROGRESS, r as AGENT_INSTRUCTIONS_FILE, s as CLAUDE_SKILL_ROOT, u as FRAMEWORK_TEMPLATES_DIR, w as SKILL_ROOT, y as LEGACY_REPO_SKILL_ROOT } from "./repo-DkR12VUv.js";
|
|
2
|
+
import { i as resolveCanonicalSkillRoot, r as resolveBundledPackageRoot, t as copyCanonicalSkill } from "./installer-UgNasLjl.js";
|
|
3
3
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
//#region skills/first-tree/engine/runtime/upgrader.ts
|
|
@@ -37,13 +37,15 @@ function formatUpgradeTaskList(repo, localVersion, packagedVersion, layout) {
|
|
|
37
37
|
const lines = [
|
|
38
38
|
`# Context Tree Upgrade — v${localVersion} -> v${packagedVersion}\n`,
|
|
39
39
|
"## Installed Skill",
|
|
40
|
-
`- [ ] Review local customizations under
|
|
40
|
+
`- [ ] Review local customizations under ${installedSkillRootsDisplay()} and reapply them if needed`,
|
|
41
41
|
`- [ ] Re-copy any workflow updates you want from \`${FRAMEWORK_WORKFLOWS_DIR}/\` into \`.github/workflows/\``,
|
|
42
|
-
`- [ ] Re-check any local agent setup that references \`${
|
|
42
|
+
`- [ ] Re-check any local agent setup that references \`${CLAUDE_SKILL_ROOT}/assets/framework/examples/\` or \`${CLAUDE_SKILL_ROOT}/assets/framework/helpers/\``,
|
|
43
|
+
`- [ ] Re-check any repo scripts or workflow files that reference \`${SKILL_ROOT}/assets/framework/\``,
|
|
43
44
|
""
|
|
44
45
|
];
|
|
45
46
|
const migrationTasks = [];
|
|
46
47
|
if (layout === "legacy") migrationTasks.push("- [ ] Remove any stale `.context-tree/` references from repo-specific docs, scripts, or workflow files");
|
|
48
|
+
if (layout === "legacy-repo-skill") lines.push("## Migration", `- [ ] Remove any stale \`${LEGACY_REPO_SKILL_ROOT}/\` references from repo-specific docs, scripts, workflow files, or agent config`, "");
|
|
47
49
|
if (layout === "legacy-skill") migrationTasks.push(`- [ ] Remove any stale \`${LEGACY_SKILL_ROOT}/\` references from repo-specific docs, scripts, workflow files, or agent config`);
|
|
48
50
|
if (repo.hasCanonicalAgentInstructionsFile() && repo.hasLegacyAgentInstructionsFile()) migrationTasks.push(`- [ ] Merge any remaining user-authored content from \`${LEGACY_AGENT_INSTRUCTIONS_FILE}\` into \`${AGENT_INSTRUCTIONS_FILE}\`, then delete the legacy file`);
|
|
49
51
|
else if (repo.hasLegacyAgentInstructionsFile()) migrationTasks.push(`- [ ] Rename \`${LEGACY_AGENT_INSTRUCTIONS_FILE}\` to \`${AGENT_INSTRUCTIONS_FILE}\` to use the canonical agent instructions filename`);
|
|
@@ -87,7 +89,8 @@ function runUpgrade(repo, options) {
|
|
|
87
89
|
console.log("The installed framework is newer than the skill bundled with this `first-tree` package. Install a newer package version before running `context-tree upgrade`.");
|
|
88
90
|
return 1;
|
|
89
91
|
}
|
|
90
|
-
|
|
92
|
+
const missingInstalledRoots = workingRepo.missingInstalledSkillRoots();
|
|
93
|
+
if (layout === "skill" && missingInstalledRoots.length === 0 && packagedVersion === localVersion) {
|
|
91
94
|
console.log(`Already up to date with the bundled skill (${FRAMEWORK_VERSION} = ${localVersion}).`);
|
|
92
95
|
return 0;
|
|
93
96
|
}
|
|
@@ -97,9 +100,11 @@ function runUpgrade(repo, options) {
|
|
|
97
100
|
recursive: true,
|
|
98
101
|
force: true
|
|
99
102
|
});
|
|
100
|
-
console.log(
|
|
101
|
-
} else if (layout === "legacy-skill") console.log(
|
|
102
|
-
else console.log(
|
|
103
|
+
console.log(`Migrated legacy .context-tree/ layout to ${installedSkillRootsDisplay()}.`);
|
|
104
|
+
} else if (layout === "legacy-repo-skill") console.log(`Migrated legacy ${LEGACY_REPO_SKILL_ROOT}/ layout to ${installedSkillRootsDisplay()}.`);
|
|
105
|
+
else if (layout === "legacy-skill") console.log(`Migrated ${LEGACY_SKILL_ROOT}/ to ${installedSkillRootsDisplay()}.`);
|
|
106
|
+
else if (missingInstalledRoots.length > 0) console.log(`Repaired missing installed skill roots (${missingInstalledRoots.map((root) => `${root}/`).join(", ")}) and refreshed ${installedSkillRootsDisplay()} from the bundled first-tree package.`);
|
|
107
|
+
else console.log(`Refreshed ${installedSkillRootsDisplay()} from the bundled first-tree package.`);
|
|
103
108
|
const output = formatUpgradeTaskList(workingRepo, localVersion, packagedVersion, layout);
|
|
104
109
|
console.log(`\n${output}`);
|
|
105
110
|
writeProgress(workingRepo, output);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as LEGACY_SKILL_ROOT, h as LEGACY_AGENT_INSTRUCTIONS_FILE, n as Repo, r as AGENT_INSTRUCTIONS_FILE, w as SKILL_ROOT } from "./repo-DkR12VUv.js";
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
3
|
import { join, relative, resolve } from "node:path";
|
|
4
4
|
//#region skills/first-tree/engine/validators/members.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "first-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "CLI tools for Context Tree — the living source of truth for your organization.",
|
|
5
5
|
"homepage": "https://github.com/agent-team-foundation/first-tree#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"type": "module",
|
|
21
21
|
"bin": {
|
|
22
|
-
"context-tree": "
|
|
22
|
+
"context-tree": "dist/cli.js"
|
|
23
23
|
},
|
|
24
24
|
"imports": {
|
|
25
25
|
"#skill/*": "./skills/first-tree/*",
|
|
@@ -30,6 +30,15 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"skills/first-tree"
|
|
32
32
|
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsdown",
|
|
35
|
+
"prepack": "pnpm build",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"eval": "vitest run --config vitest.eval.config.ts",
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"validate:skill": "python3 ./skills/first-tree/scripts/quick_validate.py ./skills/first-tree && bash ./skills/first-tree/scripts/check-skill-sync.sh"
|
|
40
|
+
},
|
|
41
|
+
"packageManager": "pnpm@10.25.0",
|
|
33
42
|
"license": "Apache-2.0",
|
|
34
43
|
"devDependencies": {
|
|
35
44
|
"@types/node": "^25.5.0",
|
|
@@ -37,12 +46,5 @@
|
|
|
37
46
|
"typescript": "^5.8.0",
|
|
38
47
|
"vitest": "^3.2.0",
|
|
39
48
|
"yaml": "^2.8.3"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "tsdown",
|
|
43
|
-
"test": "vitest run",
|
|
44
|
-
"eval": "vitest run --config vitest.eval.config.ts",
|
|
45
|
-
"typecheck": "tsc --noEmit",
|
|
46
|
-
"validate:skill": "python3 ./skills/first-tree/scripts/quick_validate.py ./skills/first-tree && bash ./skills/first-tree/scripts/check-skill-sync.sh"
|
|
47
49
|
}
|
|
48
|
-
}
|
|
50
|
+
}
|
|
@@ -6,8 +6,9 @@ description: Maintain the canonical `first-tree` skill and the thin `context-tre
|
|
|
6
6
|
# First Tree
|
|
7
7
|
|
|
8
8
|
Use this skill when the task depends on the exact behavior of the
|
|
9
|
-
`context-tree` CLI or the installed
|
|
10
|
-
`context-tree init` ships to user
|
|
9
|
+
`context-tree` CLI or the installed `.agents/skills/first-tree/` and
|
|
10
|
+
`.claude/skills/first-tree/` payloads that `context-tree init` ships to user
|
|
11
|
+
repos.
|
|
11
12
|
|
|
12
13
|
## Source Of Truth
|
|
13
14
|
|
|
@@ -17,9 +18,9 @@ Use this skill when the task depends on the exact behavior of the
|
|
|
17
18
|
repos.
|
|
18
19
|
- `engine/` holds the canonical framework and CLI behavior.
|
|
19
20
|
- `scripts/` holds maintenance helpers for validating and running the skill.
|
|
20
|
-
- In maintainer docs, use `context-tree` for the CLI
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
- In maintainer docs, use `context-tree` for the CLI, `skills/first-tree/` for
|
|
22
|
+
the bundled source path, and `.agents/skills/first-tree/` /
|
|
23
|
+
`.claude/skills/first-tree/` for installed user-repo paths.
|
|
23
24
|
|
|
24
25
|
## When To Read What
|
|
25
26
|
|
|
@@ -61,11 +62,12 @@ Use this skill when the task depends on the exact behavior of the
|
|
|
61
62
|
repo when invoked from a source/workspace repo. Use `--here` to initialize
|
|
62
63
|
the current repo in place when you are already inside the tree repo.
|
|
63
64
|
- `context-tree init` installs this skill into the target tree repo and
|
|
65
|
+
scaffolds `.agents/skills/first-tree/`, `.claude/skills/first-tree/`,
|
|
64
66
|
`NODE.md`, `AGENTS.md`, and `members/NODE.md`.
|
|
65
67
|
- `context-tree upgrade` refreshes the installed skill from the copy bundled
|
|
66
68
|
with the currently running `first-tree` package. To pick up a newer
|
|
67
69
|
framework, run a newer package version first. It also migrates older repos
|
|
68
|
-
that still use `skills/first-tree-cli-framework/`.
|
|
70
|
+
that still use `skills/first-tree/` or `skills/first-tree-cli-framework/`.
|
|
69
71
|
- The user's tree content lives outside the skill; the skill only carries the
|
|
70
72
|
reusable framework payload plus maintenance guidance.
|
|
71
73
|
- The tree still stores decisions, constraints, and ownership; execution detail
|
|
@@ -79,6 +81,8 @@ Use this skill when the task depends on the exact behavior of the
|
|
|
79
81
|
- Keep decision knowledge in the tree and execution detail in source systems.
|
|
80
82
|
- Keep the skill as the only canonical knowledge source. The root CLI/package
|
|
81
83
|
shell must not become a second source of framework semantics.
|
|
84
|
+
- Keep the CLI name written as `context-tree` in maintainer and user-facing
|
|
85
|
+
docs so it is not confused with the `first-tree` package that ships it.
|
|
82
86
|
- Keep normal `init` / `upgrade` flows self-contained. They must work from the
|
|
83
87
|
skill bundled in the current package without cloning the source repo or
|
|
84
88
|
relying on network access.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.1
|
|
@@ -6,9 +6,9 @@ Copy `settings.json` to your tree repo's `.claude/` directory:
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
mkdir -p .claude
|
|
9
|
-
cp skills/first-tree/assets/framework/examples/claude-code/settings.json .claude/settings.json
|
|
9
|
+
cp .claude/skills/first-tree/assets/framework/examples/claude-code/settings.json .claude/settings.json
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## What It Does
|
|
13
13
|
|
|
14
|
-
The `SessionStart` hook runs
|
|
14
|
+
The `SessionStart` hook runs `./.claude/skills/first-tree/assets/framework/helpers/inject-tree-context.sh` when a Claude Code session begins. This injects the root `NODE.md` content as additional context, giving the agent an overview of the tree structure before any task.
|
|
@@ -205,7 +205,7 @@ export function generate(
|
|
|
205
205
|
return 0;
|
|
206
206
|
}
|
|
207
207
|
console.log(
|
|
208
|
-
"CODEOWNERS is out-of-date. Run: npx tsx skills/first-tree/assets/framework/helpers/generate-codeowners.ts",
|
|
208
|
+
"CODEOWNERS is out-of-date. Run: npx tsx .agents/skills/first-tree/assets/framework/helpers/generate-codeowners.ts",
|
|
209
209
|
);
|
|
210
210
|
return 1;
|
|
211
211
|
}
|
|
File without changes
|
|
@@ -39,7 +39,7 @@ function buildPrompt(diffPath: string): string {
|
|
|
39
39
|
["Root NODE.md", "NODE.md"],
|
|
40
40
|
[
|
|
41
41
|
"Review Instructions",
|
|
42
|
-
"skills/first-tree/assets/framework/prompts/pr-review.md",
|
|
42
|
+
".agents/skills/first-tree/assets/framework/prompts/pr-review.md",
|
|
43
43
|
],
|
|
44
44
|
];
|
|
45
45
|
for (const [heading, path] of files) {
|
|
@@ -13,7 +13,7 @@ You are working in a **Context Tree** — the living source of truth for decisio
|
|
|
13
13
|
|
|
14
14
|
4. **Git-native tree structure.** Each node is a file; each domain is a directory. Soft links allow cross-references without the complexity of a full graph. History, ownership, and review follow Git conventions.
|
|
15
15
|
|
|
16
|
-
See
|
|
16
|
+
See `.agents/skills/first-tree/references/principles.md` for detailed explanations and examples.
|
|
17
17
|
|
|
18
18
|
## Before Every Task
|
|
19
19
|
|
|
@@ -41,7 +41,7 @@ Ask yourself: **Does the tree need updating?**
|
|
|
41
41
|
|
|
42
42
|
## Reference
|
|
43
43
|
|
|
44
|
-
For ownership rules, tree structure, and key files, see [NODE.md](NODE.md) and
|
|
44
|
+
For ownership rules, tree structure, and key files, see [NODE.md](NODE.md) and `.agents/skills/first-tree/references/ownership-and-naming.md`.
|
|
45
45
|
<!-- END CONTEXT-TREE FRAMEWORK -->
|
|
46
46
|
|
|
47
47
|
# Project-Specific Instructions
|
|
@@ -34,8 +34,8 @@ tree describes.
|
|
|
34
34
|
|
|
35
35
|
See [AGENTS.md](AGENTS.md) for agent instructions — the before/during/after workflow, ownership model, and tree maintenance.
|
|
36
36
|
|
|
37
|
-
See [about.md](skills/first-tree/references/about.md) for background — the problem, the idea, and who it's for.
|
|
37
|
+
See [about.md](.agents/skills/first-tree/references/about.md) for background — the problem, the idea, and who it's for.
|
|
38
38
|
|
|
39
39
|
See the installed framework documentation:
|
|
40
|
-
- [principles.md](skills/first-tree/references/principles.md) — core principles with examples
|
|
41
|
-
- [ownership-and-naming.md](skills/first-tree/references/ownership-and-naming.md) — node naming and ownership model
|
|
40
|
+
- [principles.md](.agents/skills/first-tree/references/principles.md) — core principles with examples
|
|
41
|
+
- [ownership-and-naming.md](.agents/skills/first-tree/references/ownership-and-naming.md) — node naming and ownership model
|