skills-init 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ezra Apple
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ ![skills-init banner](./assets/banner.png)
2
+
3
+ # skills-init
4
+
5
+ Drop a small, opinionated agent skill system into any new project.
6
+
7
+ `skills-init` creates a single source of truth at `.agents/skills`, installs a
8
+ portable baseline of high-leverage skills, and symlinks those skills into the
9
+ tool-specific folders agents already know how to read:
10
+
11
+ ```text
12
+ .claude/skills/<skill> -> ../../.agents/skills/<skill>
13
+ .cursor/skills/<skill> -> ../../.agents/skills/<skill>
14
+ .codex/skills/<skill> -> ../../.agents/skills/<skill>
15
+ .opencode/skills/<skill> -> ../../.agents/skills/<skill>
16
+ ```
17
+
18
+ The idea is simple: your project carries the actual context once, and every
19
+ agent surface sees the same guidance.
20
+
21
+ ## Quick Start
22
+
23
+ NPM package is coming next. Until then, run it directly from GitHub:
24
+
25
+ ```bash
26
+ npx github:EzraApple/skills-init
27
+ ```
28
+
29
+ After npm publish, the intended command is:
30
+
31
+ ```bash
32
+ npx skills-init
33
+ ```
34
+
35
+ Useful options:
36
+
37
+ ```bash
38
+ skills-init --target .
39
+ skills-init --target . --dry-run
40
+ skills-init --target . --overwrite
41
+ skills-init --target . --no-links
42
+ skills-init --target . --copy-links
43
+ skills-init --list
44
+ ```
45
+
46
+ ## What It Installs
47
+
48
+ Default profile: `core`
49
+
50
+ ```text
51
+ .agents/
52
+ README.md
53
+ skills/
54
+ adversarial-review/
55
+ SKILL.md
56
+ simplify/
57
+ SKILL.md
58
+ writing-skills/
59
+ SKILL.md
60
+ mcps/
61
+ README.md
62
+
63
+ .claude/skills/* -> .agents/skills/*
64
+ .cursor/skills/* -> .agents/skills/*
65
+ .codex/skills/* -> .agents/skills/*
66
+ .opencode/skills/* -> .agents/skills/*
67
+ ```
68
+
69
+ `.agents/mcps` is intentionally just a placeholder today. The package is built
70
+ around profiles so MCP setup, tool config, and additional skill packs can be
71
+ added later without changing the core installer model.
72
+
73
+ ## Included Skills
74
+
75
+ ### `adversarial-review`
76
+
77
+ High-scrutiny independent review for code, PRs, changed files, plans, or
78
+ specific paths.
79
+
80
+ Includes:
81
+
82
+ - scope selection for PRs, diffs, files, and local changes;
83
+ - reviewer lane selection based on risk and user intent;
84
+ - correctness, security, architecture, interface, test/ops, and UX lane
85
+ templates;
86
+ - clustering findings by root cause;
87
+ - validator passes whose job is to kill weak findings;
88
+ - an iterative hardening loop for fix, check, and rerun cycles;
89
+ - final report shape with verdict, action items, findings, and coverage.
90
+
91
+ Use this when you want a skeptical second opinion, not a polite rubber stamp.
92
+
93
+ ### `writing-skills`
94
+
95
+ The meta-skill for creating and maintaining useful skills.
96
+
97
+ Includes:
98
+
99
+ - how to define a skill's job, trigger phrases, audience, and output;
100
+ - where skills should live: `.agents/skills`, tool links, always-on guidance,
101
+ scripts, or runtime workspace directories;
102
+ - frontmatter rules for discoverable `name` and `description`;
103
+ - guidance for progressive disclosure with `references/`, `scripts/`,
104
+ `templates/`, and `assets/`;
105
+ - validation levels from lightweight checks to rigorous pressure scenarios;
106
+ - anti-patterns like narrative skills, workflow-hidden descriptions, and
107
+ untested routing changes.
108
+
109
+ Use this when you are turning repeated agent behavior into durable project
110
+ context.
111
+
112
+ ### `simplify`
113
+
114
+ Deletion-first code simplification for agents that tend to add wrappers,
115
+ helpers, and speculative abstractions.
116
+
117
+ Includes:
118
+
119
+ - direct-version-first thinking;
120
+ - single-use helper inlining;
121
+ - guard-clause and flattening guidance;
122
+ - deriving values instead of synchronizing state;
123
+ - collapsing parallel code paths;
124
+ - one-name-per-concept naming discipline;
125
+ - rules for passing objects whole and deleting translation theater;
126
+ - near-miss guidance for cases where added lines are still the simpler choice.
127
+
128
+ Use this after implementation or during review to ask: what can we delete
129
+ without losing clarity or safety?
130
+
131
+ ## Why This Exists
132
+
133
+ Agent tools are getting better, but new projects still start cold. The same
134
+ instructions get pasted into prompts, copied between repos, or forgotten until a
135
+ review goes sideways.
136
+
137
+ `skills-init` makes project context explicit and portable:
138
+
139
+ - skills live in the repo;
140
+ - tool-specific folders are generated;
141
+ - repeated judgment becomes reusable guidance;
142
+ - future MCP and tool setup has a place to grow.
143
+
144
+ ## Repo Structure
145
+
146
+ ```text
147
+ assets/ README images and package-visible assets
148
+ bin/ CLI entrypoint
149
+ profiles/ data-driven install profiles
150
+ scripts/ package validation scripts
151
+ skills/ source skills copied into target projects
152
+ src/ installer implementation
153
+ templates/ files written into target projects
154
+ test/ Node test runner coverage
155
+ ```
156
+
157
+ ## Local Development
158
+
159
+ Run from this checkout:
160
+
161
+ ```bash
162
+ node bin/skills-init.js --target /path/to/project
163
+ ```
164
+
165
+ Run checks:
166
+
167
+ ```bash
168
+ npm run check
169
+ ```
170
+
171
+ This validates skill frontmatter, runs installer tests, and verifies package
172
+ contents with `npm pack --dry-run`.
173
+
174
+ ## Extending
175
+
176
+ Add a skill:
177
+
178
+ 1. Create `skills/<skill-name>/SKILL.md`.
179
+ 2. Add the skill name to `profiles/core.json` or a new profile.
180
+ 3. Run `npm run check`.
181
+
182
+ Add future MCP support:
183
+
184
+ 1. Put MCP templates or descriptors under `templates/` or a future `mcps/`
185
+ source directory.
186
+ 2. Add profile entries describing when they install.
187
+ 3. Keep writes idempotent.
188
+ 4. Never overwrite user config unless `--overwrite` explicitly allows it.
189
+
190
+ The installer should stay boring: copy durable source context into `.agents`,
191
+ then generate tool-specific views over that context.
192
+
193
+ ## License
194
+
195
+ MIT
Binary file
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { run } from "../src/cli.js";
3
+
4
+ run(process.argv.slice(2)).catch((error) => {
5
+ console.error(error instanceof Error ? error.message : String(error));
6
+ process.exitCode = 1;
7
+ });
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "skills-init",
3
+ "version": "0.1.0",
4
+ "description": "Scaffold portable agent skills into a project.",
5
+ "type": "module",
6
+ "bin": {
7
+ "skills-init": "./bin/skills-init.js"
8
+ },
9
+ "files": [
10
+ "assets/",
11
+ "bin/",
12
+ "src/",
13
+ "scripts/",
14
+ "skills/",
15
+ "profiles/",
16
+ "templates/",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/EzraApple/skills-init.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/EzraApple/skills-init/issues"
26
+ },
27
+ "homepage": "https://github.com/EzraApple/skills-init#readme",
28
+ "scripts": {
29
+ "check": "npm run lint:skills && npm test && npm run pack:dry-run",
30
+ "lint:skills": "node scripts/lint-skills.js",
31
+ "pack:dry-run": "npm pack --dry-run",
32
+ "test": "node --test"
33
+ },
34
+ "keywords": [
35
+ "agents",
36
+ "skills",
37
+ "codex",
38
+ "claude",
39
+ "opencode",
40
+ "developer-tools"
41
+ ],
42
+ "author": "Ezra Apple",
43
+ "license": "MIT",
44
+ "engines": {
45
+ "node": ">=20"
46
+ }
47
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "core",
3
+ "description": "Portable baseline for code review, skill authoring, and simplification.",
4
+ "skills": [
5
+ "adversarial-review",
6
+ "writing-skills",
7
+ "simplify"
8
+ ],
9
+ "toolLinks": [
10
+ {
11
+ "tool": "claude",
12
+ "dir": ".claude/skills",
13
+ "mode": "always"
14
+ },
15
+ {
16
+ "tool": "cursor",
17
+ "dir": ".cursor/skills",
18
+ "mode": "always"
19
+ },
20
+ {
21
+ "tool": "codex",
22
+ "dir": ".codex/skills",
23
+ "mode": "always"
24
+ },
25
+ {
26
+ "tool": "opencode",
27
+ "dir": ".opencode/skills",
28
+ "mode": "always"
29
+ }
30
+ ]
31
+ }
@@ -0,0 +1,75 @@
1
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const packageRoot = fileURLToPath(new URL("..", import.meta.url));
6
+ const skillsRoot = join(packageRoot, "skills");
7
+ const descriptionLimit = 1024;
8
+ const namePattern = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
9
+ const xmlTagPattern = /<[A-Za-z][^>]*>/;
10
+
11
+ function parseFrontmatter(content, path) {
12
+ const match = /^---\n([\s\S]*?)\n---\n/.exec(content);
13
+ if (!match) {
14
+ throw new Error(`${path} is missing YAML frontmatter`);
15
+ }
16
+
17
+ const frontmatter = {};
18
+ for (const line of match[1].split("\n")) {
19
+ const field = /^([A-Za-z0-9_-]+):\s*(.*)$/.exec(line);
20
+ if (field) {
21
+ frontmatter[field[1]] = field[2].replace(/^["']|["']$/g, "");
22
+ }
23
+ }
24
+ return frontmatter;
25
+ }
26
+
27
+ const errors = [];
28
+
29
+ for (const entry of readdirSync(skillsRoot, { withFileTypes: true })) {
30
+ if (!entry.isDirectory()) {
31
+ continue;
32
+ }
33
+
34
+ const skillName = entry.name;
35
+ const skillPath = join(skillsRoot, skillName, "SKILL.md");
36
+ if (!existsSync(skillPath)) {
37
+ errors.push(`${skillName} is missing SKILL.md`);
38
+ continue;
39
+ }
40
+
41
+ const content = readFileSync(skillPath, "utf8");
42
+ const frontmatter = parseFrontmatter(content, skillPath);
43
+
44
+ if (!frontmatter.name) {
45
+ errors.push(`${skillPath} is missing name`);
46
+ } else if (!namePattern.test(frontmatter.name)) {
47
+ errors.push(`${skillPath} has invalid name "${frontmatter.name}"`);
48
+ } else if (frontmatter.name !== skillName) {
49
+ errors.push(`${skillPath} name does not match directory "${skillName}"`);
50
+ }
51
+
52
+ if (!frontmatter.description) {
53
+ errors.push(`${skillPath} is missing description`);
54
+ } else {
55
+ if (!frontmatter.description.startsWith("Use when")) {
56
+ errors.push(`${skillPath} description must start with "Use when"`);
57
+ }
58
+ if (frontmatter.description.length > descriptionLimit) {
59
+ errors.push(`${skillPath} description exceeds ${descriptionLimit} characters`);
60
+ }
61
+ if (xmlTagPattern.test(frontmatter.description)) {
62
+ errors.push(`${skillPath} description contains XML-style angle brackets`);
63
+ }
64
+ }
65
+ }
66
+
67
+ if (errors.length > 0) {
68
+ console.error("Skill lint failed:");
69
+ for (const error of errors) {
70
+ console.error(`- ${error}`);
71
+ }
72
+ process.exit(1);
73
+ }
74
+
75
+ console.log("All skills passed lint.");
@@ -0,0 +1,233 @@
1
+ ---
2
+ name: adversarial-review
3
+ description: Use when the user asks for adversarial, independent, skeptical, panel, multi-agent, second-opinion, high-scrutiny, security-minded, or critical review of a PR, branch diff, uncommitted changes, changed files, plan, or specific paths.
4
+ user-invocable: true
5
+ argument-hint: "[PR_OR_DIFF_OR_PATH]"
6
+ ---
7
+
8
+ # Adversarial Review
9
+
10
+ Use this when ordinary review is not enough. The workflow is independent
11
+ criticism, root-cause clustering, attempted takedown of findings, synthesized
12
+ action items, and reruns after fixes when edits are in scope.
13
+
14
+ The goal is not to generate more comments. The goal is to find the issues that
15
+ survive skeptical validation.
16
+
17
+ ## Core Rules
18
+
19
+ - Reviewer and validator passes are readonly. Edit only after synthesis, and
20
+ only to address validated action items.
21
+ - Do not reuse the implementation chat as evidence. Reviewers get the review
22
+ packet, not the builder's defense of the code.
23
+ - No issue quota. A clean review is valid if the probes were meaningful.
24
+ - Every finding needs a concrete failure path, target file or symbol, evidence,
25
+ and suggested fix.
26
+ - Vague concerns are not findings.
27
+ - The user gets a synthesized action list, not raw reviewer transcripts.
28
+ - Default to the hardening loop unless the user asks for report-only review.
29
+
30
+ If your runtime supports subagents, use fresh readonly subagents for reviewer and
31
+ validator passes. If it does not, run the same lanes sequentially in fresh notes:
32
+ reset assumptions between lanes, do not edit during lane work, and do not let one
33
+ lane's findings bias another until clustering.
34
+
35
+ ## Scope Selection
36
+
37
+ Pick the narrowest concrete scope before launching reviewer lanes:
38
+
39
+ 1. If the user gives a PR URL or number, review that PR with the local GitHub
40
+ tooling available in the environment.
41
+ 2. If the user names files or directories, review those paths plus directly
42
+ relevant callers.
43
+ 3. If the user gives a base or revision range, review that diff.
44
+ 4. If the current branch has a resolvable PR, review that PR.
45
+ 5. Otherwise review the branch diff from the default branch using the merge
46
+ base.
47
+ 6. Otherwise review staged, unstaged, and untracked changes.
48
+
49
+ If the resolved diff is empty, stop and say there is nothing to review.
50
+
51
+ ## Dimension Selection
52
+
53
+ Choose lanes from the user's requested dimensions, changed surfaces, and risk
54
+ profile. Do not run the same fixed panel every time.
55
+
56
+ 1. Extract explicit dimensions and exclusions from the prompt.
57
+ 2. Infer additional dimensions only when materially relevant.
58
+ 3. Skip unrelated default lanes.
59
+ 4. Use one lane for a narrow requested dimension, two or three for moderate
60
+ risk, and four or more only for broad PRs or explicit high-scrutiny requests.
61
+ 5. Ask for clarification only when two plausible lane sets would produce
62
+ materially different reviews.
63
+
64
+ Record selected lanes and skipped obvious lanes in the final coverage section.
65
+
66
+ ## Review Packet
67
+
68
+ Create one lean packet and pass the same packet to every reviewer lane.
69
+
70
+ Include:
71
+
72
+ - user request, requested dimensions, exclusions, and selected scope;
73
+ - PR title/body or local change summary when available;
74
+ - issue/ticket links when available;
75
+ - diff command used and changed file list;
76
+ - full diff or focused patch for the selected scope;
77
+ - on reruns, the disposition ledger from prior rounds.
78
+
79
+ Reference project guidance by path instead of inlining it. Reviewers may read
80
+ `AGENTS.md`, local skill docs, package docs, and full files needed to prove or
81
+ kill a finding.
82
+
83
+ Do not include implementation plans, parent-agent notes, or private reasoning
84
+ unless the user explicitly asks to review against them.
85
+
86
+ ## Lane Templates
87
+
88
+ Use these as starting points. Add or remove lanes based on the task.
89
+
90
+ | Lane | Focus question | Use for |
91
+ | --- | --- | --- |
92
+ | Correctness Critic | How does this break in production? | Runtime behavior, data flow, state, cache, idempotency, regression risk. |
93
+ | Security Critic | What can a hostile user, integration, or prompt do with this? | Auth, authorization, injection, secret exposure, unsafe logs, trust boundaries. |
94
+ | Architecture Minimalist | Is this the smallest maintainable shape? | Abstractions, duplicated pathways, wrong-layer fixes, interface bloat. |
95
+ | Interface Critic | Does the public boundary make the caller's job clear? | APIs, schemas, hooks, component props, CLI flags, cross-package contracts. |
96
+ | Test And Ops Critic | What will make this hard to verify, deploy, roll back, or debug? | Missing failure-path tests, migrations, observability, version skew, flaky assumptions. |
97
+ | Product Or UX Critic | Does behavior match the expected user outcome? | Visible behavior, copy, loading/error states, accessibility, workflow fit. |
98
+
99
+ Add domain lanes when warranted: migration safety, performance, prompt injection,
100
+ data correctness, accessibility, payments, privacy, or package publishing.
101
+
102
+ ## Reviewer Output Contract
103
+
104
+ Each reviewer returns Markdown with this shape:
105
+
106
+ ```markdown
107
+ ## <Reviewer Lane>
108
+
109
+ Verdict: BLOCK | CONCERNS | CLEAN
110
+
111
+ ### Findings
112
+
113
+ 1. ID: <stable lane-local id>
114
+ Severity: CRITICAL | WARNING | NOTE
115
+ Confidence: HIGH | MEDIUM | LOW
116
+ Target: `<path>` / `<symbol or line if known>`
117
+ Problem: <one sentence>
118
+ Evidence: <specific code path and why existing guards do not cover it>
119
+ Failure path: <input/event/state that triggers the issue>
120
+ Suggested fix: <concrete remediation>
121
+
122
+ ### Probes That Survived
123
+
124
+ - <meaningful checks that did not produce findings>
125
+ ```
126
+
127
+ Severity rubric:
128
+
129
+ - `CRITICAL`: merge-blocking correctness, data loss, security, or broken
130
+ existing contract.
131
+ - `WARNING`: should be fixed, but not merge-blocking.
132
+ - `NOTE`: informational; never becomes an action item on its own.
133
+
134
+ If there are no findings, the reviewer still lists probes that survived.
135
+
136
+ ## Clustering And Validation
137
+
138
+ Cluster first, then validate clusters. Never run one validator per raw finding.
139
+
140
+ 1. Cluster candidate findings by root cause, not by file or reviewer.
141
+ 2. Drop clusters made only of NOTE-severity or evidence-free findings.
142
+ 3. Run one fresh readonly validator pass per remaining cluster.
143
+ 4. The validator's job is to kill the finding, not defend it.
144
+
145
+ Validator output:
146
+
147
+ ```markdown
148
+ ## Validation
149
+
150
+ 1. Cluster: <finding ids>
151
+ Disposition: action-item | omit | needs-human
152
+ Evidence: <code evidence for or against the finding>
153
+ ```
154
+
155
+ Use `omit` for disputed, unproven, or confirmed-but-trivial findings. Keep a
156
+ disputed finding only when the disagreement itself changes what the user should
157
+ decide.
158
+
159
+ ## Synthesis
160
+
161
+ The parent agent synthesizes. Do not paste raw reviewer reports.
162
+
163
+ 1. Convert `action-item` clusters into action items.
164
+ 2. Route `needs-human` clusters to a human-decision bucket.
165
+ 3. Rank by merge-blocking impact, then user risk, then maintenance cost.
166
+
167
+ Verdict mapping describes the final diff after any fixes:
168
+
169
+ - `BLOCK`: at least one validated CRITICAL finding remains unfixed.
170
+ - `CONCERNS`: validated non-blocking action items or human decisions remain.
171
+ - `CLEAN`: no validated findings remain.
172
+
173
+ ## Iterative Hardening Loop
174
+
175
+ Use this loop by default when edits are in scope.
176
+
177
+ 1. Run reviewer lanes, clustering, validation, and synthesis.
178
+ 2. If validated action items remain and the local worktree is editable, fix them.
179
+ 3. Run targeted checks for touched surfaces.
180
+ 4. Refresh the packet and append a disposition ledger:
181
+ - fixed, with fix location;
182
+ - omitted, with killing evidence;
183
+ - needs-human, with the decision needed.
184
+ 5. Rerun only lanes that produced a validated finding or whose surfaces the fix
185
+ touched.
186
+ 6. Stop at a terminal state.
187
+
188
+ Terminal states:
189
+
190
+ - `clean`: fresh review leaves no validated actionable findings.
191
+ - `human-decision`: remaining findings require product, architecture, rollout, or
192
+ risk-tolerance decisions.
193
+ - `broad-refactor-required`: credible fix exceeds the requested scope; name the
194
+ subsystem boundary and why a local fix would be misleading.
195
+ - `report-only-requested`: user explicitly requested readonly review.
196
+ - `cycle-cap-reached`: three full cycles ran and validated findings remain.
197
+
198
+ ## Final Report
199
+
200
+ Use this shape:
201
+
202
+ ```markdown
203
+ ## Independent Critical Review
204
+
205
+ Verdict: BLOCK | CONCERNS | CLEAN
206
+
207
+ ### Action Items
208
+
209
+ **Before merge**
210
+ - <owner action> in `<path>` / `<symbol>` because <validated risk>.
211
+
212
+ **Verification**
213
+ - <test, check, or manual verification needed>.
214
+
215
+ **Needs human decision**
216
+ - <decision and why code alone cannot answer it>.
217
+
218
+ ### Findings
219
+
220
+ 1. **CRITICAL | WARNING | NOTE** - `<path>` / `<symbol>`
221
+ <problem and failure path>
222
+ Evidence: <why this survived validation>
223
+ Suggested fix: <concrete remediation>
224
+
225
+ ### Coverage
226
+
227
+ - Scope reviewed: <diff/path/PR>
228
+ - Lanes run: <lanes>
229
+ - Lanes intentionally skipped: <lanes and why>
230
+ - Validation: <commands or checks>
231
+ ```
232
+
233
+ If no findings survive, say so directly and include the probes that mattered.