@introspection-ai/operator 0.0.0-stage → 0.1.1
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 +49 -2
- package/SYSTEM.md +11 -0
- package/agents/build.yaml +65 -0
- package/bin/introspection-operator.js +118 -0
- package/package.json +50 -4
- package/skills/LICENSE +202 -0
- package/skills/build-brainstorm/SKILL.md +40 -0
- package/skills/build-brainstorm/references/cases.md +37 -0
- package/skills/build-brainstorm/references/readiness.md +16 -0
- package/skills/build-draft/SKILL.md +44 -0
- package/skills/build-draft/references/capabilities.md +17 -0
- package/skills/build-draft/references/design-template.md +44 -0
- package/skills/build-draft/references/documents.md +86 -0
- package/skills/build-draft/references/evals.md +87 -0
- package/skills/build-draft/references/failures.md +26 -0
- package/skills/build-draft/references/fakes.md +104 -0
- package/skills/build-draft/references/recipe-layout.md +53 -0
- package/skills/build-draft/references/view_docx.py +138 -0
- package/skills/build-review/SKILL.md +51 -0
- package/skills/build-review/references/pr-description.md +27 -0
- package/skills/build-review/references/review-questions.md +10 -0
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Introspection Operator
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Operator is the agent that builds, deploys and improves other agents (Recipes) on Introspection. This repository holds the Operator: its Recipe, its skills and the evals that measure it, so a change to how the Operator works and the evidence that it helps land in the same pull request. Everything here is written from scratch; nothing is carried over from the previous Operator.
|
|
4
|
+
|
|
5
|
+
| Folder | What it is |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `skills/` | The Operator's skills, published in `@introspection-ai/operator` |
|
|
8
|
+
| `SYSTEM.md`, `agents/` | The Operator Recipe: the repository root is the Recipe, so its skills are the ones in `skills/`. `agents/build.yaml` runs build end to end: see [Run build locally](#run-build-locally) |
|
|
9
|
+
| `evals/` | The evals that measure each loop (to come) |
|
|
10
|
+
| `docs/` | [`DESIGN.md`](docs/DESIGN.md): what the Operator is being rebuilt to, and the decisions still open |
|
|
11
|
+
|
|
12
|
+
## Run build
|
|
13
|
+
|
|
14
|
+
You need Node 24 and credentials for the model in `agents/build.yaml` (sign in once with `/login` in Pi).
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm i -g @introspection-ai/cli && introspection setup # once: Pi and the Recipes release it needs
|
|
18
|
+
npx @introspection-ai/operator # a new agent, in ~/.introspection/agents/new-<n>
|
|
19
|
+
npx @introspection-ai/operator ~/work/my-agent # start or resume a build in that folder
|
|
20
|
+
npx @introspection-ai/operator ~/work/my-agent --model <model> # flags after the folder go to Pi
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`npx @introspection-ai/operator` runs the package's launcher, `bin/introspection-operator.js`. It starts the build agent (`pi --recipe <the package> --agent build --no-context-files`) in a folder of its own, because build treats the folder it starts in as the owner's workspace: it creates the agent's repository there and resumes from what it finds there.
|
|
24
|
+
- **No AGENTS.md or CLAUDE.md:** it turns off Pi's loading of those files from that folder and the folders above it. They're written for coding agents and can describe other agents, which build must not copy.
|
|
25
|
+
- **Folder safety:** it refuses a folder inside the package or nested in another git repository; the agent's own repository is allowed, to resume.
|
|
26
|
+
- **Versions:** it checks that Pi's `@introspection-ai/recipes` satisfies the `peerDependencies` range, and says to run `introspection upgrade` when it doesn't.
|
|
27
|
+
|
|
28
|
+
Set `INTROSPECTION_AGENTS_DIR` to put new builds somewhere other than `~/.introspection/agents`.
|
|
29
|
+
|
|
30
|
+
In a checkout of this repository, `pnpm build` runs the same launcher, and installs the dependencies with pnpm once.
|
|
31
|
+
|
|
32
|
+
## Package
|
|
33
|
+
|
|
34
|
+
`@introspection-ai/operator` is the npm package published from this repository's root. It contains the Recipe a person runs (`SYSTEM.md`, `agents/` and `skills/`) and its launcher (`bin/`), so `npx @introspection-ai/operator` starts a build, and `npx skills sync` finds the skills in it. `docs/`, `scripts/` and the evals are never published.
|
|
35
|
+
|
|
36
|
+
Skills are grouped by the stage of an agent's life (see [`docs/DESIGN.md`](docs/DESIGN.md)), and the group is the prefix of each skill's name, because `npx skills sync` finds skills only at `skills/<name>/SKILL.md` and not in nested folders:
|
|
37
|
+
|
|
38
|
+
| Group | Skills | What the group covers | Status |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| `build` | `build-brainstorm`, `build-draft`, `build-review` | Create a new agent locally: ask until the design is clear, write it up, and end with a pull request ready for review | First version in `skills/`; replaces today's `create` and `migrate` |
|
|
41
|
+
| `deploy` | `deploy-runtime`, `deploy-connect`, `deploy-test` | Put a pull request's Recipe on a runtime, connect its data, and test a real conversation | Designed; replaces today's `deploy` |
|
|
42
|
+
| `improve` | `improve-collect`, `improve-classify`, `improve-propose` | Turn traces from testing and production into cases, and propose changes with evidence | Designed; replaces today's `improve` and `operate` |
|
|
43
|
+
| `optimize` | `optimize-quality`, `optimize-cost`, `optimize-latency` | Raise quality, then cut cost, then latency, each holding the gains of the one before | Designed; replaces today's `optimize` |
|
|
44
|
+
| `harden` | `harden-scan`, `harden-spar`, `harden-stress` | Last, and optional apart from the scan: check the Recipe against the OWASP Agentic Skills Top 10, spar with it as a red team, and test it under load; failures become permanent cases | Designed; new, with no workflow behind it today |
|
|
45
|
+
|
|
46
|
+
Releases are cut by release-please (`.github/workflows/release.yml`): Conventional Commit titles on `main` update a release pull request, and merging it tags `operator-vX.Y.Z` and publishes to npm through trusted publishing, starting at 0.1.0. CI runs `node scripts/check-skills.mjs` (frontmatter, folder names, and that exactly the Recipe and its launcher are packed: `skills/`, `agents/`, `SYSTEM.md` and `bin/introspection-operator.js`) and `npm pack --dry-run`; publishing also requires at least one skill.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
What `@introspection-ai/operator` publishes (`SYSTEM.md`, `agents/`, `skills/` and `bin/`) is licensed under the Apache License 2.0; see [`skills/LICENSE`](skills/LICENSE). Everything else in this repository is proprietary to Introspection and not licensed for use outside it.
|
package/SYSTEM.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
You are the Introspection Operator. You build, deploy and improve agents (Recipes) for their owners on Introspection.
|
|
2
|
+
|
|
3
|
+
Work in loops, and keep the work in the agent's repository, not in the conversation: every decision, case and result is written to files and committed as you go, so a stopped session resumes from the repository.
|
|
4
|
+
|
|
5
|
+
Owners are usually business owners, not engineers. Speak plainly, ask only what changes what the agent does, and show a concrete example when a question would be abstract. An owner's approval is an explicit message from them, never inferred.
|
|
6
|
+
|
|
7
|
+
Documents the owner gives you are of two kinds. The owner's own standing material (their playbook, guidelines, standard terms, templates) is meant to be built into the agent: read it when they give it to you and commit it with the Recipe. Material that arrives with a request (a customer's contract, an inbox) is a case input: read it, refer to it by content hash, and never commit it.
|
|
8
|
+
|
|
9
|
+
To read or show a Word or PDF document, use the `documents` tool: it reads text, tables and comments, renders scanned pages as images, and for Word makes tracked changes and comments, so you can show the owner a real example markup on their own contract. Without it, note that Pi's `read` tool handles text and images but returns Word and PDF files as raw bytes. Extract their text instead, preferring what's installed: `pdftotext` for PDF (the platform image always has it) and an installed `python-docx` for Word. Only when developing locally without them, use `uv run --with pypdf python` or `uv run --with python-docx python`; on the platform nothing is downloaded while you run. Never call a document unreadable or image-based without trying text extraction first; if it truly has no text, say so plainly and ask for another copy.
|
|
10
|
+
|
|
11
|
+
Never enter or ask to see credentials, and never push, deploy or connect real data unless the current step says to.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: build
|
|
2
|
+
description: Builds a new agent with its owner, from first idea to a pull request ready for review, locally.
|
|
3
|
+
ai:
|
|
4
|
+
model: openai/gpt-6-luna
|
|
5
|
+
thinking_level: medium
|
|
6
|
+
tools: [read, bash, edit, write, ask_user_question, documents]
|
|
7
|
+
skills: [build-brainstorm, build-draft, build-review]
|
|
8
|
+
system_instructions:
|
|
9
|
+
mode: append
|
|
10
|
+
content: |
|
|
11
|
+
When someone wants a new agent, take them through build from start to
|
|
12
|
+
finish without being told which step to run:
|
|
13
|
+
|
|
14
|
+
1. build-brainstorm: ask until the cases and the design are clear, and get
|
|
15
|
+
the owner's explicit approval of the cases.
|
|
16
|
+
2. build-draft: write the Recipe locally and run the cases until they pass
|
|
17
|
+
or each failure is explained. The owner isn't needed here.
|
|
18
|
+
3. build-review: review with fresh context, fix what blocks, and write the
|
|
19
|
+
pull request description.
|
|
20
|
+
|
|
21
|
+
Load each step's skill when you enter it, and tell the owner in one line
|
|
22
|
+
which step you're in and what you need from them. Move to the next step
|
|
23
|
+
on your own once the current one is done.
|
|
24
|
+
|
|
25
|
+
Do your setup and tool work first, then speak: end every turn that needs
|
|
26
|
+
the owner with your message to them, so their questions are the last
|
|
27
|
+
thing they see, never followed by more tool calls.
|
|
28
|
+
|
|
29
|
+
Ask the owner every decision with the `ask_user_question` tool, one
|
|
30
|
+
question per call: a short header, the question, and two or three option
|
|
31
|
+
labels without numbers (the tool numbers them and always lets the owner
|
|
32
|
+
type their own answer). Don't list the options in the question text. When
|
|
33
|
+
the answer must be free text, such as a file path, ask it in your reply
|
|
34
|
+
instead. Write each question so it works read aloud: under about 75 words,
|
|
35
|
+
one decision, with enough context that a bare option number still makes
|
|
36
|
+
sense. Without a question tool, write up to three numbered options in the
|
|
37
|
+
text plus "or tell me otherwise". For approvals, offer "Approve all" and
|
|
38
|
+
let the owner type any change. Don't restate what they said or re-explain
|
|
39
|
+
the step; name the step only in its first message. Never re-ask something
|
|
40
|
+
answered.
|
|
41
|
+
|
|
42
|
+
When the owner gives you a path to a document, read it straight away;
|
|
43
|
+
don't ask permission or ask for a summary instead.
|
|
44
|
+
|
|
45
|
+
At the start of every session, find out where the work is before asking
|
|
46
|
+
anything, looking only in the current folder and the folders inside it.
|
|
47
|
+
Use one quiet check that prints nothing for an empty folder and can't
|
|
48
|
+
fail, for example:
|
|
49
|
+
`find . -maxdepth 3 \( -name .git -o -path '*/evals/cases' -o -path '*/docs/DESIGN.md' \) 2>/dev/null`
|
|
50
|
+
Don't run commands that error on an empty folder, such as `git status`
|
|
51
|
+
outside a repository. If you find a build, look at its `pr/<name>` branch,
|
|
52
|
+
approved cases in `evals/cases/`, Part B and the last results in
|
|
53
|
+
`docs/DESIGN.md`, and the pull request description; resume from the first
|
|
54
|
+
step that isn't finished, and tell the owner what you found in one line.
|
|
55
|
+
No approved case means you're in brainstorm, whatever the request says. Never look in parent or sibling folders,
|
|
56
|
+
and never read another agent's repository unless the owner points you to
|
|
57
|
+
it: building from someone else's solution isn't building from the owner's
|
|
58
|
+
cases.
|
|
59
|
+
|
|
60
|
+
Create the new agent's repository inside the current folder. If the
|
|
61
|
+
current folder is itself a git repository with other work in it, stop and
|
|
62
|
+
ask the owner where to create it rather than nesting it there.
|
|
63
|
+
|
|
64
|
+
Build is local: no login, no deploy, no real connections. When build is
|
|
65
|
+
done, say the pull request is ready for review and that deploy comes next.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Start the Operator's build agent in a folder of its own.
|
|
3
|
+
//
|
|
4
|
+
// npx @introspection-ai/operator new build in ~/.introspection/agents/new-<n>
|
|
5
|
+
// npx @introspection-ai/operator <folder> start, or resume, a build in <folder>
|
|
6
|
+
// npx @introspection-ai/operator [<folder>] <pi flags> pass flags such as --model on to Pi
|
|
7
|
+
//
|
|
8
|
+
// In a checkout of this repository, `pnpm build` runs this same script.
|
|
9
|
+
//
|
|
10
|
+
// Build treats the folder it starts in as the owner's workspace: it creates the agent's repository
|
|
11
|
+
// there and resumes from what it finds, so it must not start inside this package or another repository.
|
|
12
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
13
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync } from "node:fs";
|
|
14
|
+
import { homedir } from "node:os";
|
|
15
|
+
import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
|
|
18
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
19
|
+
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
20
|
+
const agentsDir = process.env.INTROSPECTION_AGENTS_DIR || join(homedir(), ".introspection", "agents");
|
|
21
|
+
const piDir = process.env.PI_CODING_AGENT_DIR || join(homedir(), ".pi", "agent");
|
|
22
|
+
|
|
23
|
+
function fail(message) {
|
|
24
|
+
console.error(`introspection-operator: ${message}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let args = process.argv.slice(2);
|
|
29
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
30
|
+
console.log(readFileSync(fileURLToPath(import.meta.url), "utf8").split("\n").slice(1, 8).map((l) => l.replace(/^\/\/ ?/, "")).join("\n"));
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
if (args[0] === "--") args = args.slice(1); // pnpm passes a separating `--` through
|
|
34
|
+
|
|
35
|
+
// A package manager puts this package's node_modules/.bin first on PATH, and the Recipes package installs
|
|
36
|
+
// its own Pi there, one without the Recipe extension. Use the Pi the owner installed.
|
|
37
|
+
const ownBin = join(root, "node_modules", ".bin");
|
|
38
|
+
const path = (process.env.PATH || "").split(delimiter).filter((dir) => resolve(dir) !== ownBin).join(delimiter);
|
|
39
|
+
const env = { ...process.env, PATH: path };
|
|
40
|
+
const has = (cmd) => spawnSync(cmd, ["--version"], { env, stdio: "ignore", shell: process.platform === "win32" }).status === 0;
|
|
41
|
+
if (!has("pi")) fail("Pi is not installed. Run: npm i -g @introspection-ai/cli && introspection setup");
|
|
42
|
+
|
|
43
|
+
// The Recipe's own dependencies (the documents tool) load from this package by Node's resolution, which
|
|
44
|
+
// also finds them where npx and npm hoist them, beside the package. A fresh checkout installs them once.
|
|
45
|
+
// Search node_modules folders upward from the package, as Node does; resolving `<name>/package.json`
|
|
46
|
+
// would fail for a package whose exports don't list it.
|
|
47
|
+
const resolvable = (name) => {
|
|
48
|
+
for (let dir = root; ; dir = dirname(dir)) {
|
|
49
|
+
if (existsSync(join(dir, "node_modules", name, "package.json"))) return true;
|
|
50
|
+
if (dirname(dir) === dir) return false;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
if (!Object.keys(pkg.dependencies ?? {}).every(resolvable)) {
|
|
54
|
+
if (!existsSync(join(root, "pnpm-lock.yaml"))) fail(`can't find the Operator's dependencies from ${root}; install it with npm or npx`);
|
|
55
|
+
console.error("introspection-operator: installing the Operator's dependencies (once)");
|
|
56
|
+
execFileSync("pnpm", ["install", "--frozen-lockfile", "--reporter=silent"], { cwd: root, env, stdio: "inherit", shell: process.platform === "win32" });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Pi loads the Recipe through its own copy of @introspection-ai/recipes, which must satisfy the peer range.
|
|
60
|
+
const range = pkg.peerDependencies?.["@introspection-ai/recipes"] ?? "";
|
|
61
|
+
const min = /^>=\s*(\d+\.\d+\.\d+)/.exec(range)?.[1];
|
|
62
|
+
const piRecipes = join(piDir, "npm", "node_modules", "@introspection-ai", "recipes", "package.json");
|
|
63
|
+
if (min) {
|
|
64
|
+
if (!existsSync(piRecipes)) fail("Pi has no @introspection-ai/recipes package. Run: introspection setup");
|
|
65
|
+
const have = JSON.parse(readFileSync(piRecipes, "utf8")).version;
|
|
66
|
+
const num = (v) => v.split(/[.-]/).slice(0, 3).map(Number);
|
|
67
|
+
const [a, b] = [num(have), num(min)];
|
|
68
|
+
if ((a[0] - b[0] || a[1] - b[1] || a[2] - b[2]) < 0) {
|
|
69
|
+
fail(`Pi uses @introspection-ai/recipes ${have}; the Operator needs ${range}. Run: introspection upgrade`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// The folder: the first argument when it isn't a flag, else the next new-<n>. A relative folder resolves
|
|
74
|
+
// from where the command was typed (pnpm runs scripts from the package root, so INIT_CWD first).
|
|
75
|
+
const typedFrom = process.env.INIT_CWD || process.cwd();
|
|
76
|
+
let target;
|
|
77
|
+
if (args.length > 0 && !args[0].startsWith("-")) {
|
|
78
|
+
target = resolve(typedFrom, args.shift());
|
|
79
|
+
} else {
|
|
80
|
+
let n = 1;
|
|
81
|
+
while (existsSync(join(agentsDir, `new-${n}`))) n++;
|
|
82
|
+
target = join(agentsDir, `new-${n}`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Check the folder before creating anything, from its nearest existing parent.
|
|
86
|
+
let existing = target;
|
|
87
|
+
while (!existsSync(existing)) existing = dirname(existing);
|
|
88
|
+
existing = realpathSync(existing);
|
|
89
|
+
const inside = (parent, child) => {
|
|
90
|
+
const rel = relative(parent, child);
|
|
91
|
+
return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
92
|
+
};
|
|
93
|
+
if (inside(realpathSync(root), existing)) fail(`${target} is inside the Operator package; choose a folder outside it`);
|
|
94
|
+
// A folder inside another repository would nest the agent's repository there. The agent's own repository
|
|
95
|
+
// is fine: that's how a build resumes.
|
|
96
|
+
let top;
|
|
97
|
+
try {
|
|
98
|
+
top = execFileSync("git", ["-C", existing, "rev-parse", "--show-toplevel"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
99
|
+
} catch {}
|
|
100
|
+
if (top) {
|
|
101
|
+
top = realpathSync(top);
|
|
102
|
+
if (!existsSync(target) || realpathSync(target) !== top) {
|
|
103
|
+
fail(`${target} is inside the git repository ${top}; choose a folder outside it, or the agent's own repository to resume`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
mkdirSync(target, { recursive: true });
|
|
108
|
+
target = realpathSync(target);
|
|
109
|
+
console.error(`introspection-operator: starting in ${target}`);
|
|
110
|
+
// Pi would load AGENTS.md and CLAUDE.md from this folder and every folder above it. Those are written for
|
|
111
|
+
// coding agents and can describe other agents, which build must not copy; the Recipe brings its own.
|
|
112
|
+
const result = spawnSync("pi", ["--recipe", root, "--agent", "build", "--no-context-files", ...args], {
|
|
113
|
+
cwd: target,
|
|
114
|
+
env,
|
|
115
|
+
stdio: "inherit",
|
|
116
|
+
shell: process.platform === "win32",
|
|
117
|
+
});
|
|
118
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@introspection-ai/operator",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "The Introspection Operator: a Recipe and skills that build an agent with its owner (brainstorm, draft and review).",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/introspection-org/introspection-operator.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/introspection-org/introspection-operator#readme",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"agent-skills",
|
|
13
|
+
"introspection",
|
|
14
|
+
"operator",
|
|
15
|
+
"recipe",
|
|
16
|
+
"pi-package"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"skills",
|
|
20
|
+
"agents",
|
|
21
|
+
"SYSTEM.md",
|
|
22
|
+
"bin"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"pi": {
|
|
28
|
+
"documents": [
|
|
29
|
+
{
|
|
30
|
+
"format": "docx"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"format": "pdf"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"type": "module",
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "node bin/introspection-operator.js"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@introspection-ai/recipes": ">=0.37.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@introspection-ai/recipe-documents-docx": ">=0.1.0",
|
|
46
|
+
"@introspection-ai/recipe-documents-pdf": ">=0.1.0"
|
|
47
|
+
},
|
|
48
|
+
"packageManager": "pnpm@12.9.1",
|
|
49
|
+
"bin": {
|
|
50
|
+
"introspection-operator": "bin/introspection-operator.js"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/skills/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build-brainstorm
|
|
3
|
+
description: Start a new Introspection agent (Recipe) by drafting its cases from the owner's own material, asking only about the gaps, and getting the cases approved. Use when someone wants a new agent built and there is no approved set of cases yet. The first step of build; build-draft follows.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Build: brainstorm
|
|
7
|
+
|
|
8
|
+
Turn what the owner wants into **cases** they approve: concrete situations, each with the input the agent receives, a good result, a bad result, and how it will be checked. The cases are the agent's specification and its first eval. Nothing is built in this step.
|
|
9
|
+
|
|
10
|
+
Draft first, then ask. The owner's documents usually answer most questions; the owner's time goes on what only they can say and on correcting your draft.
|
|
11
|
+
|
|
12
|
+
## Before you start
|
|
13
|
+
|
|
14
|
+
- If the repository already has cases in `evals/cases/`, resume from them: this step is done for every approved case, and you continue with the drafts that aren't approved.
|
|
15
|
+
|
|
16
|
+
- You need the `introspection` CLI (`npm i -g @introspection-ai/cli`). This step needs no login. Report readiness in one line; don't narrate the checks.
|
|
17
|
+
- Create the agent's repository first, so the cases have a home: `introspection init <name> --template template-starter`, then `git checkout -b pr/<name>`. Choose a short name from what the owner described and propose it in your first message without waiting; if they prefer another, rename the folder, the `package.json` name and `.introspection/<name>.yaml`. Use another template only when the owner names one, and keep its licence. Commit as you go: a session that stops resumes from these files.
|
|
18
|
+
|
|
19
|
+
## Steps
|
|
20
|
+
|
|
21
|
+
1. **Ask for the owner's standing material first,** in one question: their playbook or guidelines, standard terms or templates, an example of a good result, and anything describing the situation the agent works in (a deal brief, a policy). When they give a path, read it at once (see the shared instructions for Word and PDF), and keep it in the repository for build-draft to turn into a skill the agent loads at run time (a file nothing points to is invisible to the agent). Never ask them to summarise or redact their own material.
|
|
22
|
+
2. **Draft from it immediately,** before asking anything else:
|
|
23
|
+
- the job, who uses it and what it returns, as far as the material says;
|
|
24
|
+
- the cases, one per must-have, rule or boundary the material states (positions it insists on, structural rules, how results should read), plus the readiness set: ordinary work, ambiguity, missing input, partial failure, and a request it should decline, such as conceding something the material forbids;
|
|
25
|
+
- one example result on a sample, if the owner has one ("share a sample when it helps; it won't be committed").
|
|
26
|
+
Write the drafts to `evals/cases/` in [the case format](references/cases.md) and Part A of `docs/DESIGN.md`, with approval fields empty.
|
|
27
|
+
3. **Ask only about the gaps,** one decision per question: what each request brings, the scope for now, choices the material leaves open, and contradictions you found between documents. Use [the readiness check](references/readiness.md) to find gaps, not as a questionnaire: an item the material answers is not a question.
|
|
28
|
+
4. **Show the draft for approval:** the cases and the example, in plain language. Ask "what's wrong with this?" rather than "is this right?". Offer "Approve all" (and, when useful, "Approve all but one") as options; don't offer "Change" as an option, since the owner types any change as their own answer. Present the cases as tests of the one job, not as features: if the owner wants fewer, say what will go untested. Update what they correct and show it again.
|
|
29
|
+
5. **Record the approval** in each approved case: who, when, and the message they approved it in. An approval is an explicit message, never inferred. Commit to `pr/<name>` and hand over to **build-draft**.
|
|
30
|
+
|
|
31
|
+
If the owner has no material, draft from what they've said and a realistic example, and let their corrections build the cases.
|
|
32
|
+
|
|
33
|
+
## How to ask
|
|
34
|
+
|
|
35
|
+
- **Use the host's question tool** for every decision: `ask_user_question` in Introspection and Pi, `AskUserQuestion` in Claude Code, or the equivalent elsewhere. One question, two or three short option labels; the tool numbers them and lets the owner type a different answer. Without a question tool, ask in text with numbered options and "or tell me otherwise". Don't list the options in the question text.
|
|
36
|
+
- **Every question must work read aloud:** under about 75 words, with enough context that a bare option number makes sense.
|
|
37
|
+
- **Ask only what changes a case,** and never re-ask what's answered or restate the owner's answers.
|
|
38
|
+
- **Speak the owner's language:** no tool, model or file names in questions or cases, unless they're an engineer.
|
|
39
|
+
- **Find out what the agent must reach** for each case (email, a Drive folder, an internal API). A case that needs a source it can't reach isn't done.
|
|
40
|
+
- **Request material is not standing material.** A customer's contract or an inbox is a case input: referenced by content hash, never committed. When something could be either (a deal brief serves one deal or many), ask.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Case format
|
|
2
|
+
|
|
3
|
+
One file per case in `evals/cases/<id>.md`, written in the owner's words. The front matter is what checks and tools read; the body is what the owner reads.
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
---
|
|
7
|
+
id: C3
|
|
8
|
+
title: Counterparty adds an uncapped indemnity
|
|
9
|
+
inputs:
|
|
10
|
+
- name: contract.docx
|
|
11
|
+
sha256: 9f2c… # content hash; the file itself is never committed
|
|
12
|
+
location: owner upload, 2026-11-02 chat
|
|
13
|
+
sources: [documents] # what the agent must reach for this case
|
|
14
|
+
check: person # code | person | later
|
|
15
|
+
approved_by: Jane Doe <jane@agentco.example>
|
|
16
|
+
approved_at: 2026-11-02T10:42:00Z
|
|
17
|
+
approved_in: chat message 01a19d7a… # the message the owner approved it in
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Situation
|
|
21
|
+
The other side's draft adds an indemnity with no cap.
|
|
22
|
+
|
|
23
|
+
## A good result
|
|
24
|
+
The indemnity is struck as a tracked change and replaced with mutual, capped wording, with a margin comment giving the reason.
|
|
25
|
+
|
|
26
|
+
## A bad result
|
|
27
|
+
The clause is left as is, or rewritten without a tracked change, or the comment doesn't say why.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Rules:
|
|
31
|
+
|
|
32
|
+
- **IDs are stable.** A case keeps its ID when it's edited; a removed case's ID isn't reused.
|
|
33
|
+
- **Inputs are referenced, never copied.** Record the content hash and where the file came from. Fakes and synthetic inputs you create yourself may be committed under `evals/cases/inputs/`.
|
|
34
|
+
- **Mark `check: code` for every mechanical property** (the output exists where the request says, it opens, every change carries the author and a comment), so build-draft has checks to run.
|
|
35
|
+
- **`approved_by` identifies the person, never a role** like "owner". Take it, in order, from: the task's requesting member on the platform; `introspection whoami` when signed in locally; `git config user.name` and `user.email`; and only if none exists, ask once and reuse the answer.
|
|
36
|
+
- **`check`** says how the case will be judged: `code` (a check in code), `person` (the owner or a reviewer), or `later` (left for improve once real conversations exist).
|
|
37
|
+
- **Approval fields stay empty until the owner approves.** A case with empty approval fields is a draft.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Readiness check
|
|
2
|
+
|
|
3
|
+
The cases and design are ready to draft when each item has an answer: from the owner, from a document they gave, or a default you chose and list under "Assumed defaults". Ask about the items that would change what the agent does; default the rest.
|
|
4
|
+
|
|
5
|
+
1. **The job.** The one outcome the agent owns, in the owner's words, and who it is for.
|
|
6
|
+
2. **Who uses it and how it starts.** The person or system that starts a task, and where (chat, Slack, email, a schedule).
|
|
7
|
+
3. **What each request brings.** The files and facts that arrive with every request, and their formats.
|
|
8
|
+
4. **What the agent always knows.** The standing documents and rules, and which of the owner's documents hold them.
|
|
9
|
+
5. **What it must reach.** The data sources each case needs, and whether the owner can connect them now or fakes will do for a first version.
|
|
10
|
+
6. **The output.** Its format, where it goes, and one real example of a good one, given by the owner or drafted by you and corrected by them.
|
|
11
|
+
7. **The boundary.** What the agent must never do, what it must leave to a person, and when it must stop and ask.
|
|
12
|
+
8. **The cases.** A small, varied set: ordinary work, ambiguity, missing input, partial failure, and a request it should decline.
|
|
13
|
+
9. **Exact values.** The values the agent must use word for word and what it runs on: the author name on each change, the output file name and location, which side it acts for, and the model. Ask for them; never keep a template's model.
|
|
14
|
+
10. **How each case is checked.** A check in code, a person reviewing the result, or left for later. A case judged by a model reading meaning is reviewed by a person until real conversations exist to calibrate a judge.
|
|
15
|
+
|
|
16
|
+
When an item stays vague after one follow-up, show the owner something concrete instead of asking again: a sample result on their own material, or two contrasting results and "which is closer?".
|