ide-agents 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,101 @@
1
+ ---
2
+ description: Conventions for skill scripts (generators, scanners, report writers)
3
+ globs: skills/**/scripts/**
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Skill scripts
8
+
9
+ Bundled under `skills/<skill-id>/scripts/`. Invoked by skills and agents — not installed separately by ide-agents.
10
+
11
+ Reference implementation: [repo-audit-skills](https://github.com/sergeychernov/repo-audit-skills) (`detect-stack.mjs`, `run-audit.mjs`, modular `checks/`).
12
+
13
+ ## Runtime
14
+
15
+ - ESM: `*.mjs`, `#!/usr/bin/env node`
16
+ - Node 18+, **zero npm dependencies** in scripts (stdlib only)
17
+ - Resolve skill assets via `import.meta.url` — never assume cwd for skill paths
18
+
19
+ ```javascript
20
+ import { dirname, join } from 'node:path';
21
+ import { fileURLToPath } from 'node:url';
22
+
23
+ const here = dirname(fileURLToPath(import.meta.url));
24
+ const assetsDir = join(here, '..', 'assets');
25
+ ```
26
+
27
+ ## Target repo discovery
28
+
29
+ Scripts run **from anywhere inside the user's project** (after skill symlink install). Discover the audited repo root explicitly:
30
+
31
+ ```javascript
32
+ import { execSync } from 'node:child_process';
33
+
34
+ const repoRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf8' }).trim();
35
+ process.chdir(repoRoot);
36
+ ```
37
+
38
+ Exit `1` with a clear message if not a git repo.
39
+
40
+ ## File header (required)
41
+
42
+ Every entry script documents usage at the top:
43
+
44
+ ```javascript
45
+ #!/usr/bin/env node
46
+ // my-skill: one-line purpose
47
+ //
48
+ // Usage (from anywhere inside a git repo):
49
+ // node <SKILL_DIR>/scripts/my-script.mjs
50
+ // node <SKILL_DIR>/scripts/my-script.mjs --json
51
+ // node <SKILL_DIR>/scripts/my-script.mjs --dry-run
52
+ ```
53
+
54
+ `<SKILL_DIR>` is the installed skill folder path (global or project symlink).
55
+
56
+ ## CLI flags (standard)
57
+
58
+ | Flag | Effect |
59
+ |------|--------|
60
+ | `--json` | Machine-readable stdout |
61
+ | `--dry-run` | Run logic without writing output files |
62
+ | `--force` | Overwrite existing generated files (when applicable) |
63
+
64
+ Add skill-specific flags (`--offline`, `--verbose`, …) only when documented in the header.
65
+
66
+ ## Scan and write rules
67
+
68
+ - Prefer `git ls-files` over unbounded filesystem walks
69
+ - **Read-only** toward source files in the target repo by default
70
+ - Writable outputs only under paths the skill documents (e.g. `.audit/profile.json`, `.audit/reports/*.json`)
71
+ - Static config and schemas stay in `skills/<id>/assets/` — edit markers here, not in the target project
72
+ - No network calls in scan scripts unless the skill explicitly requires it
73
+
74
+ ## Output
75
+
76
+ - Human mode: short labeled summary for the terminal
77
+ - JSON mode: stable schema for agents to parse
78
+ - JSON files: 2-space indent, trailing newline
79
+ - Stamp artifacts with `generatedBy`, `version`, `generatedAt` when writing reports
80
+
81
+ ## Layout inside a skill
82
+
83
+ ```
84
+ skills/<name>/
85
+ ├── SKILL.md
86
+ ├── scripts/
87
+ │ ├── run-*.mjs # entry points
88
+ │ ├── load-*.mjs # shared loaders
89
+ │ └── checks/ # optional modular checks
90
+ └── assets/ # JSON registries, markers, schemas
91
+ ```
92
+
93
+ Split large generators into `scripts/checks/` modules (see `audit-debt/scripts/checks/`).
94
+
95
+ ## SKILL.md integration
96
+
97
+ Each skill with scripts must include in `SKILL.md`:
98
+
99
+ 1. Folder tree showing `scripts/` and `assets/`
100
+ 2. **Quick start** — copy-pasteable `node <SKILL_DIR>/scripts/….mjs`
101
+ 3. **Agent instructions** — resolve skill dir, run script, read output
@@ -0,0 +1,60 @@
1
+ # Skills & agents catalog
2
+
3
+ A git repository of **IDE skills** and **agents** for Cursor, Claude Code, and Codex.
4
+
5
+ Managed with [ide-agents](https://github.com/sergeychernov/ide-agents) — clone this repo in the UI, then install artifacts globally or per project.
6
+
7
+ ## Layout
8
+
9
+ ```
10
+ .
11
+ ├── skills/
12
+ │ └── <skill-id>/
13
+ │ ├── SKILL.md # required — frontmatter: name, description, scope
14
+ │ ├── scripts/ # optional — *.mjs generators (see .cursor/rules/scripts.mdc)
15
+ │ └── assets/ # optional — JSON/markers for scripts
16
+ ├── agents/
17
+ │ └── <agent-id>.md # orchestrators — call scripts, not inline generators
18
+ ├── .cursor/rules/ # Cursor project rules (repo structure)
19
+ ├── .claude/CLAUDE.md # Claude Code project instructions
20
+ └── .agents/AGENTS.md # Codex project instructions
21
+ ```
22
+
23
+ ## SKILL.md frontmatter
24
+
25
+ ```yaml
26
+ ---
27
+ name: my-skill
28
+ description: What this skill does.
29
+ scope: any # global | project | any
30
+ ---
31
+ ```
32
+
33
+ ## Agents
34
+
35
+ Agent files live in `agents/<agent-id>.md`. YAML frontmatter:
36
+
37
+ ```yaml
38
+ ---
39
+ name: my-agent
40
+ description: When the IDE should delegate to this subagent.
41
+ scope: any # global | project | any — ide-agents install toggles only
42
+ ---
43
+ ```
44
+
45
+ `name` must match the filename stem (`agents/oracle.md` → `name: oracle`). Subagents install to `~/.cursor/agents/<name>.md` (or project `.cursor/agents/`); invoke in Agent mode by name, not via the `/` skill menu.
46
+
47
+ ## Sample artifacts
48
+
49
+ This repo was bootstrapped with a demo skill and a starter agent. Extend or replace them as you build your catalog.
50
+
51
+ | Kind | ID | Purpose |
52
+ |------|-----|---------|
53
+ | skill | `hello` | Install smoke-test + `scripts/now.mjs` (system clock) |
54
+ | agent | `oracle` | Joke fortune-teller — always upbeat predictions |
55
+
56
+ ## Next steps
57
+
58
+ 1. Edit or add skills under `skills/` and agents under `agents/`.
59
+ 2. Commit and push to your remote.
60
+ 3. In ide-agents, open **Skills** / **Agents** and toggle **Global** or **Project** to symlink into your IDE.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: oracle
3
+ description: Playful fortune-teller subagent — upbeat predictions only, never doom.
4
+ scope: any
5
+ ---
6
+
7
+ # Oracle
8
+
9
+ You are a cheerful, slightly theatrical fortune teller for **entertainment only**. You read the vibes, squint at the horizon, and deliver short prophecies — always **optimistic**, never alarming.
10
+
11
+ This is not financial, medical, or legal advice. Say so once if the user asks about money, health, or lawsuits.
12
+
13
+ ## Workflow
14
+
15
+ 1. Optional anchor in the present: if the `hello` skill is available, run
16
+ `node <SKILL_DIR>/scripts/now.mjs --json`
17
+ and weave the real timestamp into your opening (“The stars align at …”).
18
+ 2. Ask for a topic if missing (career, side project, weekend, coffee, code review — anything goes).
19
+ 3. Deliver **one** prophecy in 3–5 sentences: vivid, warm, lightly funny. No hedging, no warnings, no “but on the other hand”.
20
+ 4. End with a single lucky token (emoji, silly number, or absurd ritual) — e.g. “lucky semicolon”, “42% more sunshine”.
21
+
22
+ ## Tone
23
+
24
+ - Warm, playful, confident — like a friend who only owns good news.
25
+ - Never predict failure, illness, layoffs, breakups, or bugs that cannot be fixed.
26
+ - If the user pushes for bad news, reframes it as a plot twist that still ends well.
27
+
28
+ ## Output format
29
+
30
+ ```
31
+ 🔮 Oracle says
32
+
33
+ <prophecy paragraphs>
34
+
35
+ Lucky sign: <one line>
36
+ ```
37
+
38
+ Keep it under ~120 words unless the user asks for an epic saga.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: hello
3
+ description: Demo skill — verifies ide-agents install and reads accurate local time via a bundled script.
4
+ scope: any
5
+ ---
6
+
7
+ # Hello
8
+
9
+ Smoke-test skill that shows why **scripts beat chat** for deterministic output: the agent runs a bundled Node script that reads the **host system clock** (not model guesswork).
10
+
11
+ ## Skill layout
12
+
13
+ ```
14
+ skills/hello/
15
+ ├── SKILL.md
16
+ └── scripts/
17
+ └── now.mjs
18
+ ```
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ node <SKILL_DIR>/scripts/now.mjs
24
+ node <SKILL_DIR>/scripts/now.mjs --json
25
+ ```
26
+
27
+ Replace `<SKILL_DIR>` with the installed skill path (global or project symlink from ide-agents).
28
+
29
+ ## Workflow
30
+
31
+ When the user invokes this skill or asks for a hello / time check:
32
+
33
+ 1. Resolve `<SKILL_DIR>` (installed `hello` skill folder).
34
+ 2. Run `node <SKILL_DIR>/scripts/now.mjs --json`.
35
+ 3. Parse the JSON — fields `local`, `timeZone`, `utcOffset`, `iso`, `unixMs`.
36
+ 4. Greet the user briefly and **quote the script output** as the authoritative local time.
37
+ 5. Do not invent or approximate the time in prose; if the script fails, report the error.
38
+
39
+ ## Agent instructions
40
+
41
+ - Prefer `--json` so the time is machine-parseable.
42
+ - Human summary example: “Hello — your system clock says … (timezone …).”
43
+ - This skill has no `assets/` folder; the script uses only Node stdlib and `Intl`.
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+ // hello: read the host system clock and print accurate local time
3
+ //
4
+ // Usage:
5
+ // node <SKILL_DIR>/scripts/now.mjs
6
+ // node <SKILL_DIR>/scripts/now.mjs --json
7
+
8
+ import process, { argv } from 'node:process';
9
+
10
+ const flags = new Set(
11
+ argv.slice(2).filter((a) => a.startsWith('--')).map((a) => a.slice(2)),
12
+ );
13
+ const jsonOut = flags.has('json');
14
+
15
+ const now = new Date();
16
+ const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
17
+ const offsetMinutes = -now.getTimezoneOffset();
18
+
19
+ function formatUtcOffset(minutes) {
20
+ const sign = minutes >= 0 ? '+' : '-';
21
+ const abs = Math.abs(minutes);
22
+ const hours = String(Math.floor(abs / 60)).padStart(2, '0');
23
+ const mins = String(abs % 60).padStart(2, '0');
24
+ return `UTC${sign}${hours}:${mins}`;
25
+ }
26
+
27
+ const payload = {
28
+ source: 'system clock',
29
+ unixMs: now.getTime(),
30
+ unixSeconds: Math.floor(now.getTime() / 1000),
31
+ iso: now.toISOString(),
32
+ local: now.toLocaleString(undefined, {
33
+ timeZone,
34
+ dateStyle: 'full',
35
+ timeStyle: 'long',
36
+ }),
37
+ timeZone,
38
+ utcOffset: formatUtcOffset(offsetMinutes),
39
+ platform: process.platform,
40
+ };
41
+
42
+ if (jsonOut) {
43
+ process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
44
+ } else {
45
+ process.stdout.write('Local time (system clock)\n');
46
+ process.stdout.write(` ${payload.local}\n`);
47
+ process.stdout.write(` ${payload.utcOffset} · ${payload.timeZone}\n`);
48
+ process.stdout.write(` ISO: ${payload.iso}\n`);
49
+ }