@fro.bot/systematic 3.31.2 → 3.31.4
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/ATTRIBUTIONS.md +117 -2
- package/dist/cli.js +9 -2
- package/dist/{index-8rz6cepj.js → index-bm6qkspg.js} +189 -24
- package/dist/index.js +1 -1
- package/dist/lib/config.d.ts +32 -0
- package/dist/lib/frontmatter.d.ts +4 -2
- package/dist/pi.js +189 -24
- package/package.json +1 -1
- package/skills/agent-native-architecture/SKILL.md +1 -0
- package/skills/agent-native-audit/SKILL.md +1 -0
- package/skills/ce-brainstorm/SKILL.md +1 -0
- package/skills/ce-compound/SKILL.md +1 -0
- package/skills/ce-compound-refresh/SKILL.md +1 -0
- package/skills/ce-ideate/SKILL.md +1 -0
- package/skills/ce-plan/SKILL.md +1 -0
- package/skills/ce-review/SKILL.md +1 -0
- package/skills/ce-work/SKILL.md +1 -0
- package/skills/compound-docs/SKILL.md +1 -0
- package/skills/deepen-plan/SKILL.md +1 -0
- package/skills/deploy-docs/SKILL.md +1 -0
- package/skills/document-review/SKILL.md +1 -0
- package/skills/git-clean-gone-branches/SKILL.md +1 -0
- package/skills/git-commit/SKILL.md +1 -0
- package/skills/git-commit-push-pr/SKILL.md +1 -0
- package/skills/lfg/SKILL.md +1 -0
- package/skills/onboarding/SKILL.md +1 -0
- package/skills/report-bug-ce/SKILL.md +1 -0
- package/skills/reproduce-bug/SKILL.md +1 -0
- package/skills/resolve-pr-feedback/SKILL.md +1 -0
- package/skills/slfg/SKILL.md +1 -0
- package/skills/test-browser/SKILL.md +1 -0
- package/skills/todos/SKILL.md +1 -0
package/ATTRIBUTIONS.md
CHANGED
|
@@ -4,7 +4,7 @@ Systematic ships bundled skills and agents adapted from third-party sources. Thi
|
|
|
4
4
|
|
|
5
5
|
## License Conventions
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This file is the authoritative attribution surface for every derived file, including agents and sub-files, which carry no `license:` field. The entry-point `SKILL.md` of a derived skill may declare a `license:` field in its YAML frontmatter. The field names the primary upstream license of that skill and holds one value, even when the skill derives from more than one source. For example, `frontend-design` carries `Apache-2.0` from `pbakaus/impeccable`, and its compound-engineering lineage (MIT) is recorded only in that source's section below. A skill vendored from a single upstream, such as `agent-browser`, carries no field and is attributed only here. A missing `license:` field never means that attribution is not required: check the sections below. A file not listed in any section below is not recorded as derived from a third-party source.
|
|
8
8
|
|
|
9
9
|
The full repository license is in `LICENSE` at the repository root.
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ The full repository license is in `LICENSE` at the repository root.
|
|
|
14
14
|
**Pinned commit:** `f2cbfbefebbfef77321e4c9abc9e949826bea9d7` (tag `v5.1.0`)
|
|
15
15
|
**License:** MIT
|
|
16
16
|
**Copyright:** Copyright (c) 2025 Jesse Vincent
|
|
17
|
-
**Cloned at:** `.slim/clonedeps/repos/obra__superpowers
|
|
17
|
+
**Cloned at:** `.slim/clonedeps/repos/obra__superpowers/`, recreated on demand from `.slim/clonedeps.json` (gitignored; development inspection only; not shipped)
|
|
18
18
|
|
|
19
19
|
### Files derived
|
|
20
20
|
|
|
@@ -488,6 +488,121 @@ See the License for the specific language governing permissions and
|
|
|
488
488
|
limitations under the License.
|
|
489
489
|
```
|
|
490
490
|
|
|
491
|
+
## EveryInc/compound-engineering-plugin — MIT
|
|
492
|
+
|
|
493
|
+
**Source repository:** [`EveryInc/compound-engineering-plugin`](https://github.com/EveryInc/compound-engineering-plugin)
|
|
494
|
+
**Pinned commit:** `59dbaef37607354d103113f05c13b731eecbb690` (upstream `main`, committed 2026-04-17T09:00:37Z)
|
|
495
|
+
**Later ports:** `8cc07acb5299db5331c359395738d5fe32df50c5` (2026-04-28T05:17:02Z) for ten reference files added in #319; `debc915c5886a22c049e871304b7f991363e1155` (2026-06-05T05:31:36Z) for six reference files and the phases merged into `ce-brainstorm` and `ce-plan` in #486
|
|
496
|
+
**License:** MIT
|
|
497
|
+
**Copyright:** Copyright (c) 2025 Kieran Klaassen (`plugins/compound-engineering/LICENSE`); Copyright (c) 2025 Every (`LICENSE` at the repository root)
|
|
498
|
+
|
|
499
|
+
### Provenance
|
|
500
|
+
|
|
501
|
+
- Systematic imported compound-engineering content from its first commit (2026-01-23). Bulk syncs ran from February to April 2026 through a converter and a `sync-manifest.json` that recorded an upstream commit for each definition (for example #62, #63 and #261).
|
|
502
|
+
- #290 (2026-04-17) ran one last reconciliation sync of 63 definitions, then deleted the sync tooling and the manifest. No upstream SHA was recorded for that sync, so the pinned commit above is reconstructed. It is upstream `main` when #290 began: the PR's first commit is 2026-04-17T16:11:45Z, and the next upstream commit (`12aaad31ebd17686db1a75d1d3575da79d1dad2b`, 2026-04-17T18:40:54Z) is not reflected in the shipped files. Across upstream's commits from 2026-04-01 to 2026-04-19, line-level comparison of the files that changed in that window peaks at this commit. The previous upstream commit, `e7cf0ae9571e260a00db458dd8e2281c37f1ec8b`, differs from it only in files Systematic did not import.
|
|
503
|
+
- Five files were deleted upstream before the pinned commit. For these, the SHA below is the one the manifest recorded, and the shipped text matches that upstream version:
|
|
504
|
+
|
|
505
|
+
| Shipped file | Upstream commit |
|
|
506
|
+
|---|---|
|
|
507
|
+
| `agents/workflow/bug-reproduction-validator.md` | `f744b797efca368c986e4c8595e09a4f75e57a11` |
|
|
508
|
+
| `skills/compound-docs/SKILL.md` | `56b174a0563107b3084d780a1e6ae5a909ebeef3` |
|
|
509
|
+
| `skills/deepen-plan/SKILL.md` | `54bea268f2b5b9056607a75dd7ffccab8903ae77` |
|
|
510
|
+
| `skills/reproduce-bug/SKILL.md` | `0fdc25a36cabea4ce9e2ae47ff69c1a9a2de8f0b` |
|
|
511
|
+
| `skills/slfg/SKILL.md` | `fed9fd68db283c64ec11293f88a8ad7a6373e2fe` |
|
|
512
|
+
|
|
513
|
+
- The `assets/` and `references/` files of `skills/compound-docs/` were replaced in 2026-10 (#1228) with adapted copies of the `ce-compound` files at the pinned commit.
|
|
514
|
+
|
|
515
|
+
### Files derived
|
|
516
|
+
|
|
517
|
+
The list is grouped by directory because it covers 119 files. Every file under a listed skill directory is derived unless a bullet says otherwise.
|
|
518
|
+
|
|
519
|
+
Agents (36 files):
|
|
520
|
+
|
|
521
|
+
- `agents/design/`: `design-iterator`
|
|
522
|
+
- `agents/document-review/`: `adversarial-document-reviewer`, `coherence-reviewer`, `design-lens-reviewer`, `feasibility-reviewer`, `product-lens-reviewer`, `scope-guardian-reviewer`, `security-lens-reviewer`
|
|
523
|
+
- `agents/research/`: `best-practices-researcher`, `framework-docs-researcher`, `git-history-analyzer`, `issue-intelligence-analyst`, `learnings-researcher`, `repo-research-analyst`, `slack-researcher`
|
|
524
|
+
- `agents/review/`: `adversarial-reviewer`, `agent-native-reviewer`, `api-contract-reviewer`, `architecture-strategist`, `cli-readiness-reviewer`, `code-simplicity-reviewer`, `correctness-reviewer`, `data-migrations-reviewer`, `deployment-verification-agent`, `kieran-typescript-reviewer`, `maintainability-reviewer`, `pattern-recognition-specialist`, `performance-reviewer`, `previous-comments-reviewer`, `project-standards-reviewer`, `reliability-reviewer`, `security-reviewer`, `testing-reviewer`
|
|
525
|
+
- `agents/workflow/`: `bug-reproduction-validator`, `pr-comment-resolver`, `spec-flow-analyzer`
|
|
526
|
+
|
|
527
|
+
Skills (83 files in 26 directories):
|
|
528
|
+
|
|
529
|
+
- `skills/agent-native-architecture/` (15 files), `skills/agent-native-audit/`, `skills/ce-brainstorm/` (8), `skills/ce-compound/` (4), `skills/ce-compound-refresh/` (4), `skills/ce-ideate/` (2), `skills/ce-work/` (2), `skills/compound-docs/` (4), `skills/deepen-plan/`, `skills/deploy-docs/`, `skills/document-review/` (5), `skills/frontend-design/`, `skills/git-clean-gone-branches/` (2), `skills/git-commit/`, `skills/git-commit-push-pr/`, `skills/git-worktree/` (2), `skills/lfg/`, `skills/onboarding/` (2), `skills/report-bug-ce/`, `skills/reproduce-bug/`, `skills/resolve-pr-feedback/` (5), `skills/slfg/`, `skills/test-browser/`, `skills/todos/` (2; it merges upstream's `todo-create`, `todo-triage` and `todo-resolve`)
|
|
530
|
+
- `skills/ce-plan/`: all files except `references/prior-art-survey-schema.json`, which was written in Systematic
|
|
531
|
+
- `skills/ce-review/`: `SKILL.md` and `references/` `diff-scope.md`, `findings-schema.json`, `persona-catalog.md`, `resolve-base.sh`, `review-output-template.md` and `subagent-template.md`. The other files in the directory were written in Systematic.
|
|
532
|
+
|
|
533
|
+
Five of these files were imported from upstream and have since been largely rewritten here: `agents/research/learnings-researcher.md`, `skills/git-worktree/SKILL.md`, `skills/git-worktree/scripts/worktree-manager.sh`, `skills/ce-review/references/findings-schema.json` and `skills/ce-brainstorm/references/visual-communication.md` (modelled on the `ce-plan` file of the same name). They are listed because their lineage is upstream, not because much upstream text remains.
|
|
534
|
+
|
|
535
|
+
`skills/frontend-design/SKILL.md` also carries Apache 2.0 material from `pbakaus/impeccable` (see above).
|
|
536
|
+
|
|
537
|
+
### Adaptation notes
|
|
538
|
+
|
|
539
|
+
- The sync converter and a batch pass rewrote upstream's harness-specific text: `compound-engineering:<category>:<name>` agent references became `systematic:<category>:<name>`, `.compound-engineering/` and `.context/compound-engineering/` paths became Systematic paths, `plugins/compound-engineering/` path examples and `ai:compound-engineering` identity strings were rewritten, `Claude Code` became `OpenCode` (later harness-neutral wording), `CLAUDE.md` became `AGENTS.md`, `.claude/` became `.opencode/`, `${CLAUDE_PLUGIN_ROOT}` paths became relative paths, and tool names such as `AskUserQuestion` and `TaskCreate` were mapped to harness equivalents.
|
|
540
|
+
- Model fields were removed from every bundled agent (#336), so the agents are model-free. Frontmatter was otherwise mapped to the fields Systematic's loader reads.
|
|
541
|
+
- Systematic did not follow upstream's 2026-04-18 rename to a `ce-` prefix (#503). Some names differ from upstream's current ones, for example `document-review` (`ce-doc-review`), `git-commit` (`ce-commit`), `git-commit-push-pr` (`ce-commit-push-pr`), `git-clean-gone-branches` (`ce-clean-gone-branches`), `git-worktree` (`ce-worktree`) and `report-bug-ce` (`ce-report-bug`).
|
|
542
|
+
- The `.mjs` scripts under `skills/` are formatted by Biome (single quotes, no semicolons), so they differ from upstream line by line while keeping the same logic. A CodeQL fix in #261 also changed some regexes in `skills/onboarding/scripts/inventory.mjs`.
|
|
543
|
+
- The files have been edited in Systematic, not re-synced, since #290. Measured by line overlap with the version shipped at #290, 72 of the 95 derived files that existed then still match at least 90% of their lines, and 19 more match 50% to 90%. Four fall below 50%: `skills/ce-review/references/persona-catalog.md`, `skills/document-review/references/review-output-template.md`, and two `skills/compound-docs/` files that were replaced with the `ce-compound` versions. The five largely rewritten files above are counted separately. The other 19 derived files were added after #290 (in #319, #486 and later).
|
|
544
|
+
- Per-file copyright comments are not used. The 24 entry-point `SKILL.md` files of derived skills carry `license: MIT` in their frontmatter: every skill listed above except `skills/frontend-design/` (`Apache-2.0`, from `pbakaus/impeccable`) and `skills/git-worktree/` (lineage only). Agents and sub-files carry no field, so this section is their attribution surface.
|
|
545
|
+
|
|
546
|
+
### Future refresh discipline
|
|
547
|
+
|
|
548
|
+
Future refreshes from compound-engineering are explicit human-reviewed events, not automatic syncs. No sync tooling remains (it was removed in #290). To refresh, diff the pinned commit above against the new upstream commit and apply that diff onto Systematic's copy. Do not copy upstream files over Systematic's. Record the new pinned commit here.
|
|
549
|
+
|
|
550
|
+
### Upstream MIT license text
|
|
551
|
+
|
|
552
|
+
The following are the full MIT license texts from `EveryInc/compound-engineering-plugin@59dbaef37607354d103113f05c13b731eecbb690`, reproduced here in compliance with the license's notice requirements. The two files are identical except for the copyright holder on the third line. Neither file changed in upstream between 2026-01-23 and the pinned commit.
|
|
553
|
+
|
|
554
|
+
`plugins/compound-engineering/LICENSE`, the directory the derived files were copied from:
|
|
555
|
+
|
|
556
|
+
```
|
|
557
|
+
MIT License
|
|
558
|
+
|
|
559
|
+
Copyright (c) 2025 Kieran Klaassen
|
|
560
|
+
|
|
561
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
562
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
563
|
+
in the Software without restriction, including without limitation the rights
|
|
564
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
565
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
566
|
+
furnished to do so, subject to the following conditions:
|
|
567
|
+
|
|
568
|
+
The above copyright notice and this permission notice shall be included in all
|
|
569
|
+
copies or substantial portions of the Software.
|
|
570
|
+
|
|
571
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
572
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
573
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
574
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
575
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
576
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
577
|
+
SOFTWARE.
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
`LICENSE`, at the upstream repository root:
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
MIT License
|
|
584
|
+
|
|
585
|
+
Copyright (c) 2025 Every
|
|
586
|
+
|
|
587
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
588
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
589
|
+
in the Software without restriction, including without limitation the rights
|
|
590
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
591
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
592
|
+
furnished to do so, subject to the following conditions:
|
|
593
|
+
|
|
594
|
+
The above copyright notice and this permission notice shall be included in all
|
|
595
|
+
copies or substantial portions of the Software.
|
|
596
|
+
|
|
597
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
598
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
599
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
600
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
601
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
602
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
603
|
+
SOFTWARE.
|
|
604
|
+
```
|
|
605
|
+
|
|
491
606
|
## Anthropic — CC-BY-4.0
|
|
492
607
|
|
|
493
608
|
**Source page:** [Skill authoring best practices](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices)
|
package/dist/cli.js
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
SEARCH_NOTICES,
|
|
48
48
|
SEARCH_CONFIG_UNREADABLE_NOTE,
|
|
49
49
|
runSearch
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-bm6qkspg.js";
|
|
51
51
|
var __defProp = Object.defineProperty;
|
|
52
52
|
var __returnValue = (v) => v;
|
|
53
53
|
function __exportSetter(name, newValue) {
|
|
@@ -1638,7 +1638,8 @@ function generateEntries(repoRoot, configOptions) {
|
|
|
1638
1638
|
if (!configOptions)
|
|
1639
1639
|
return { entries, disabledFilenames: new Set };
|
|
1640
1640
|
const { config, overlays } = loadConfigWithSources(configOptions.cwd, {
|
|
1641
|
-
includeProject: configOptions.scope === "project"
|
|
1641
|
+
includeProject: configOptions.scope === "project",
|
|
1642
|
+
projectFailure: "throw"
|
|
1642
1643
|
});
|
|
1643
1644
|
const disabledAgents = new Set(config.disabled_agents);
|
|
1644
1645
|
const enabled = [];
|
|
@@ -3876,6 +3877,9 @@ function printResolvedSection() {
|
|
|
3876
3877
|
const hasOverlays = Object.keys(overlays.agents).length > 0 || Object.keys(overlays.categories).length > 0;
|
|
3877
3878
|
console.log(`
|
|
3878
3879
|
Resolved configuration:`);
|
|
3880
|
+
if (loaded.skippedProject !== undefined) {
|
|
3881
|
+
console.log(` Project config skipped: ${displaySafe(loaded.skippedProject.path)} (${displaySafe(loaded.skippedProject.reason)}). Its settings are not applied.`);
|
|
3882
|
+
}
|
|
3879
3883
|
if (!hasProfileSelection && !hasOverlays) {
|
|
3880
3884
|
console.log(" No profiles are selected and no per-agent/category overlays are defined.");
|
|
3881
3885
|
return true;
|
|
@@ -3938,6 +3942,9 @@ function buildConfigShowJson() {
|
|
|
3938
3942
|
}));
|
|
3939
3943
|
return {
|
|
3940
3944
|
locations,
|
|
3945
|
+
...loaded.skippedProject !== undefined && {
|
|
3946
|
+
projectSkipped: loaded.skippedProject
|
|
3947
|
+
},
|
|
3941
3948
|
activeProfile: loaded.metadata.activeProfile,
|
|
3942
3949
|
profileSelectorSource: loaded.metadata.profileSelectorSource,
|
|
3943
3950
|
activeProfileSourcePath: loaded.activeProfileSourcePath,
|
|
@@ -8215,8 +8215,12 @@ function readSearchBlock(filePath, maxBytes) {
|
|
|
8215
8215
|
if (text.kind !== "text")
|
|
8216
8216
|
return text;
|
|
8217
8217
|
const content = text.content;
|
|
8218
|
+
if (maxBytes !== undefined && content.trim() === "")
|
|
8219
|
+
return { kind: "absent" };
|
|
8218
8220
|
const errors = [];
|
|
8219
|
-
const parsed = parse(content, errors
|
|
8221
|
+
const parsed = parse(content, errors, {
|
|
8222
|
+
allowTrailingComma: true
|
|
8223
|
+
});
|
|
8220
8224
|
const firstError = errors[0];
|
|
8221
8225
|
if (firstError) {
|
|
8222
8226
|
return {
|
|
@@ -9796,6 +9800,12 @@ function warnDroppedNames(dropped, field, warned, removalVersion, warningSink =
|
|
|
9796
9800
|
}
|
|
9797
9801
|
var OVERSIZED_FILE_REASON = `file is larger than ${MAX_PROJECT_CONFIG_BYTES / (1024 * 1024)} MB`;
|
|
9798
9802
|
var USER_LEVEL_CONFIG_MAX_BYTES = Number.POSITIVE_INFINITY;
|
|
9803
|
+
function configFileError(filePath, detail) {
|
|
9804
|
+
return Object.assign(new Error(`Invalid Systematic config in ${filePath}: ${detail}`), { detail });
|
|
9805
|
+
}
|
|
9806
|
+
function hasFailureDetail(error) {
|
|
9807
|
+
return error instanceof Error && typeof error.detail === "string";
|
|
9808
|
+
}
|
|
9799
9809
|
function readConfigText(filePath, maxBytes) {
|
|
9800
9810
|
const read = readBytesBounded(filePath, maxBytes);
|
|
9801
9811
|
switch (read.kind) {
|
|
@@ -9804,28 +9814,32 @@ function readConfigText(filePath, maxBytes) {
|
|
|
9804
9814
|
case "absent":
|
|
9805
9815
|
if (!configEntryExists(filePath))
|
|
9806
9816
|
return null;
|
|
9807
|
-
throw
|
|
9817
|
+
throw configFileError(filePath, "unable to read file");
|
|
9808
9818
|
case "too-large":
|
|
9809
|
-
throw
|
|
9819
|
+
throw configFileError(filePath, `unable to read file (${OVERSIZED_FILE_REASON})`);
|
|
9810
9820
|
case "not-regular":
|
|
9811
|
-
throw
|
|
9821
|
+
throw configFileError(filePath, "unable to read file (not a regular file)");
|
|
9812
9822
|
default:
|
|
9813
|
-
throw
|
|
9823
|
+
throw configFileError(filePath, "unable to read file");
|
|
9814
9824
|
}
|
|
9815
9825
|
}
|
|
9816
|
-
function loadJsoncFile(filePath, maxBytes) {
|
|
9826
|
+
function loadJsoncFile(filePath, maxBytes, emptyIsAbsent) {
|
|
9817
9827
|
const content = readConfigText(filePath, maxBytes);
|
|
9818
9828
|
if (content === null)
|
|
9819
9829
|
return null;
|
|
9830
|
+
if (emptyIsAbsent && content.trim() === "")
|
|
9831
|
+
return null;
|
|
9820
9832
|
const errors = [];
|
|
9821
|
-
const parsed = parse(content, errors
|
|
9833
|
+
const parsed = parse(content, errors, {
|
|
9834
|
+
allowTrailingComma: true
|
|
9835
|
+
});
|
|
9822
9836
|
if (errors.length > 0) {
|
|
9823
9837
|
const error = errors[0];
|
|
9824
9838
|
const message = error ? `${printParseErrorCode(error.error)} at offset ${error.offset}` : "unknown parse error";
|
|
9825
|
-
throw
|
|
9839
|
+
throw configFileError(filePath, `JSONC parse error: ${message}`);
|
|
9826
9840
|
}
|
|
9827
9841
|
if (!isRecord3(parsed)) {
|
|
9828
|
-
throw
|
|
9842
|
+
throw configFileError(filePath, "root must be an object");
|
|
9829
9843
|
}
|
|
9830
9844
|
return parsed;
|
|
9831
9845
|
}
|
|
@@ -9926,7 +9940,7 @@ function loadConfigSource(input) {
|
|
|
9926
9940
|
} = input;
|
|
9927
9941
|
const trust = LAYER_TRUST[layer];
|
|
9928
9942
|
try {
|
|
9929
|
-
const rawConfig = loadJsoncFile(filePath, layer === "project" ? MAX_PROJECT_CONFIG_BYTES : USER_LEVEL_CONFIG_MAX_BYTES);
|
|
9943
|
+
const rawConfig = loadJsoncFile(filePath, layer === "project" ? MAX_PROJECT_CONFIG_BYTES : USER_LEVEL_CONFIG_MAX_BYTES, layer === "project");
|
|
9930
9944
|
if (!rawConfig) {
|
|
9931
9945
|
return {
|
|
9932
9946
|
metadata: { kind: trust, presence: "absent" },
|
|
@@ -9959,10 +9973,12 @@ function loadConfigSource(input) {
|
|
|
9959
9973
|
if (invalidSource === "throw")
|
|
9960
9974
|
throw error;
|
|
9961
9975
|
const errorCode = classifyConfigSourceError(error);
|
|
9962
|
-
|
|
9976
|
+
const reason = describeConfigSourceFailure(error, errorCode);
|
|
9977
|
+
input.reportInvalid(filePath, errorCode, reason);
|
|
9963
9978
|
return {
|
|
9964
9979
|
metadata: { errorCode, kind: trust, presence: "invalid" },
|
|
9965
|
-
source: null
|
|
9980
|
+
source: null,
|
|
9981
|
+
failure: reason
|
|
9966
9982
|
};
|
|
9967
9983
|
}
|
|
9968
9984
|
}
|
|
@@ -9994,6 +10010,61 @@ function classifyConfigSourceError(error) {
|
|
|
9994
10010
|
function isConfigSchemaError(error) {
|
|
9995
10011
|
return isRecord3(error) && error._tag === "ConfigSchemaError";
|
|
9996
10012
|
}
|
|
10013
|
+
function schemaDefinition(node) {
|
|
10014
|
+
if (!isRecord3(node))
|
|
10015
|
+
return;
|
|
10016
|
+
const internals = node._zod;
|
|
10017
|
+
const definition = isRecord3(internals) ? internals.def : node.def;
|
|
10018
|
+
return isRecord3(definition) ? definition : undefined;
|
|
10019
|
+
}
|
|
10020
|
+
function unwrapSchemaNode(node) {
|
|
10021
|
+
let current = node;
|
|
10022
|
+
for (let depth = 0;depth < 16; depth += 1) {
|
|
10023
|
+
const definition = schemaDefinition(current);
|
|
10024
|
+
if (definition === undefined)
|
|
10025
|
+
return current;
|
|
10026
|
+
const inner = definition.innerType ?? definition.in;
|
|
10027
|
+
if (inner === undefined)
|
|
10028
|
+
return current;
|
|
10029
|
+
current = inner;
|
|
10030
|
+
}
|
|
10031
|
+
return current;
|
|
10032
|
+
}
|
|
10033
|
+
function redactedSchemaPath(path, root) {
|
|
10034
|
+
const segments = [];
|
|
10035
|
+
let node = root;
|
|
10036
|
+
for (const segment of path) {
|
|
10037
|
+
const definition = schemaDefinition(unwrapSchemaNode(node));
|
|
10038
|
+
const shape = definition?.type === "object" ? definition.shape : undefined;
|
|
10039
|
+
if (isRecord3(shape) && Object.hasOwn(shape, String(segment))) {
|
|
10040
|
+
segments.push(String(segment));
|
|
10041
|
+
node = shape[String(segment)];
|
|
10042
|
+
} else if (definition?.type === "array") {
|
|
10043
|
+
segments.push("<index>");
|
|
10044
|
+
node = definition.element;
|
|
10045
|
+
} else {
|
|
10046
|
+
segments.push("<key>");
|
|
10047
|
+
node = definition?.type === "record" ? definition.valueType : undefined;
|
|
10048
|
+
}
|
|
10049
|
+
}
|
|
10050
|
+
return segments;
|
|
10051
|
+
}
|
|
10052
|
+
function describeConfigSourceFailure(error, code) {
|
|
10053
|
+
if (isConfigSchemaError(error)) {
|
|
10054
|
+
const [issue] = error.issues;
|
|
10055
|
+
if (issue === undefined)
|
|
10056
|
+
return "schema validation failed";
|
|
10057
|
+
const segments = redactedSchemaPath(issue.path, SystematicConfigSchema);
|
|
10058
|
+
const where = sanitizeDiagnosticText(segments.join("."));
|
|
10059
|
+
if (issue.code === "unrecognized_keys") {
|
|
10060
|
+
return segments.length === 0 ? "schema validation failed: unrecognized key at the top level" : `schema validation failed: unrecognized key under \`${where}\``;
|
|
10061
|
+
}
|
|
10062
|
+
return segments.length === 0 ? "schema validation failed" : `schema validation failed at \`${where}\``;
|
|
10063
|
+
}
|
|
10064
|
+
if (hasFailureDetail(error))
|
|
10065
|
+
return error.detail;
|
|
10066
|
+
return code;
|
|
10067
|
+
}
|
|
9997
10068
|
function resolveConfigSourcePath(filePath) {
|
|
9998
10069
|
try {
|
|
9999
10070
|
return fs5.realpathSync(filePath);
|
|
@@ -10314,6 +10385,15 @@ function createInvalidFileReporter(warningSink) {
|
|
|
10314
10385
|
warningSink(`[systematic] config file (${sanitizeDiagnosticText(filePath)}) is invalid (${code}) and was not loaded.`);
|
|
10315
10386
|
};
|
|
10316
10387
|
}
|
|
10388
|
+
var skippedProjectNotices = new Set;
|
|
10389
|
+
function noticeSkippedProjectConfig(filePath, reason, warningSink) {
|
|
10390
|
+
const identity = `${resolveConfigSourcePath(filePath)}\x00${reason}`;
|
|
10391
|
+
if (skippedProjectNotices.has(identity))
|
|
10392
|
+
return;
|
|
10393
|
+
skippedProjectNotices.add(identity);
|
|
10394
|
+
warningSink(`[systematic] project config (${sanitizeDiagnosticText(filePath)}) was skipped: ${reason}. None of its settings were loaded. Fix the file to apply them.`);
|
|
10395
|
+
}
|
|
10396
|
+
var PROJECT_CONFIG_MERGE_FAILURE_REASON = "it could not be combined with the other config layers";
|
|
10317
10397
|
function reassignLayer(loaded, layer) {
|
|
10318
10398
|
const trust = LAYER_TRUST[layer];
|
|
10319
10399
|
return {
|
|
@@ -10401,10 +10481,60 @@ function mergeBootstrap(sources) {
|
|
|
10401
10481
|
return merged;
|
|
10402
10482
|
}
|
|
10403
10483
|
function loadConfigWithSources(projectDir, options) {
|
|
10484
|
+
const warningSink = options?.warningSink ?? console.warn;
|
|
10485
|
+
if (!(options?.includeProject ?? true) || options?.projectFailure === "throw") {
|
|
10486
|
+
return loadConfigLayers(projectDir, options, {
|
|
10487
|
+
warningSink,
|
|
10488
|
+
projectContributed: false
|
|
10489
|
+
});
|
|
10490
|
+
}
|
|
10491
|
+
const held = [];
|
|
10492
|
+
const flush = (messages) => {
|
|
10493
|
+
for (const message of messages)
|
|
10494
|
+
warningSink(message);
|
|
10495
|
+
};
|
|
10496
|
+
const attempt = {
|
|
10497
|
+
warningSink: (message) => {
|
|
10498
|
+
held.push(message);
|
|
10499
|
+
},
|
|
10500
|
+
projectContributed: false
|
|
10501
|
+
};
|
|
10502
|
+
try {
|
|
10503
|
+
const result = loadConfigLayers(projectDir, options, attempt);
|
|
10504
|
+
flush(held);
|
|
10505
|
+
return result;
|
|
10506
|
+
} catch (error) {
|
|
10507
|
+
if (!attempt.projectContributed) {
|
|
10508
|
+
flush(held);
|
|
10509
|
+
throw error;
|
|
10510
|
+
}
|
|
10511
|
+
const retryHeld = [];
|
|
10512
|
+
let retried;
|
|
10513
|
+
try {
|
|
10514
|
+
retried = loadConfigLayers(projectDir, options, {
|
|
10515
|
+
warningSink: (message) => {
|
|
10516
|
+
retryHeld.push(message);
|
|
10517
|
+
},
|
|
10518
|
+
omitProjectBecause: PROJECT_CONFIG_MERGE_FAILURE_REASON,
|
|
10519
|
+
projectContributed: false
|
|
10520
|
+
});
|
|
10521
|
+
} catch {
|
|
10522
|
+
flush(held);
|
|
10523
|
+
throw error;
|
|
10524
|
+
}
|
|
10525
|
+
flush(retryHeld);
|
|
10526
|
+
if (retried.skippedProject) {
|
|
10527
|
+
noticeSkippedProjectConfig(retried.skippedProject.path, retried.skippedProject.reason, warningSink);
|
|
10528
|
+
}
|
|
10529
|
+
return retried;
|
|
10530
|
+
}
|
|
10531
|
+
}
|
|
10532
|
+
function loadConfigLayers(projectDir, options, attempt) {
|
|
10404
10533
|
const includeProject = options?.includeProject ?? true;
|
|
10405
10534
|
const invalidSource = options?.invalidSource ?? "throw";
|
|
10535
|
+
const projectFailure = options?.projectFailure ?? "skip";
|
|
10406
10536
|
const paths = getConfigPaths(projectDir, options);
|
|
10407
|
-
const warningSink =
|
|
10537
|
+
const warningSink = attempt.warningSink;
|
|
10408
10538
|
const reportInvalid = createInvalidFileReporter(warningSink);
|
|
10409
10539
|
if (includeProject)
|
|
10410
10540
|
emitProjectLocationWarnings(paths, warningSink);
|
|
@@ -10422,19 +10552,17 @@ function loadConfigWithSources(projectDir, options) {
|
|
|
10422
10552
|
const homeDir = resolveUserLevelConfigDirs(options).homeDir || os3.homedir();
|
|
10423
10553
|
const projectAllowed = () => isAllowedProject(resolveProjectIdentity(paths.projectRoot), mergedSearch.settings?.allow_project_sources ?? [], { homeDir });
|
|
10424
10554
|
const aliasLoaded = aliasedFiles.some(({ layer }) => userLevel[USER_LEVEL_SLOT[layer]].source !== null);
|
|
10425
|
-
const project =
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10555
|
+
const project = loadProjectSource({
|
|
10556
|
+
attempt,
|
|
10557
|
+
includeProject,
|
|
10558
|
+
paths,
|
|
10559
|
+
projectFailure,
|
|
10560
|
+
stripSink: boundedProjectStrip.sink,
|
|
10431
10561
|
allowProjectProfiles,
|
|
10432
10562
|
projectAllowed
|
|
10433
|
-
})
|
|
10434
|
-
metadata: { kind: "project", presence: "absent" },
|
|
10435
|
-
source: null
|
|
10436
|
-
};
|
|
10563
|
+
});
|
|
10437
10564
|
const projectSource = project.source;
|
|
10565
|
+
attempt.projectContributed = projectSource !== null;
|
|
10438
10566
|
emitTopLevelProtectedFieldWarning(projectSource, "profiles", `\`profiles\` in project config (%PATH%) is only valid in user config or OPENCODE_CONFIG_DIR config and has been ignored. Its bundles are not selectable even if this project also sets \`profile\`.`, boundedProjectStrip.sink);
|
|
10439
10567
|
emitTopLevelProtectedFieldWarning(projectSource, "allow_project_profiles", `\`allow_project_profiles\` in project config (%PATH%) is only valid in user config or OPENCODE_CONFIG_DIR config and has been ignored.`, boundedProjectStrip.sink);
|
|
10440
10568
|
emitProjectSearchProtectedWarnings(projectSource, boundedProjectStrip.sink);
|
|
@@ -10537,9 +10665,46 @@ function loadConfigWithSources(projectDir, options) {
|
|
|
10537
10665
|
}),
|
|
10538
10666
|
overlays,
|
|
10539
10667
|
piSubagentsOverlays: mergedPiSubagentsOverlays,
|
|
10540
|
-
activeProfileSourcePath: profileSelection.bundleSource?.path ?? null
|
|
10668
|
+
activeProfileSourcePath: profileSelection.bundleSource?.path ?? null,
|
|
10669
|
+
...project.failure !== undefined && {
|
|
10670
|
+
skippedProject: { path: paths.projectConfig, reason: project.failure }
|
|
10671
|
+
}
|
|
10541
10672
|
};
|
|
10542
10673
|
}
|
|
10674
|
+
function loadProjectSource(input) {
|
|
10675
|
+
const { attempt, paths } = input;
|
|
10676
|
+
if (!input.includeProject) {
|
|
10677
|
+
return { metadata: { kind: "project", presence: "absent" }, source: null };
|
|
10678
|
+
}
|
|
10679
|
+
if (attempt.omitProjectBecause !== undefined) {
|
|
10680
|
+
return {
|
|
10681
|
+
metadata: {
|
|
10682
|
+
errorCode: "source-invalid",
|
|
10683
|
+
kind: "project",
|
|
10684
|
+
presence: "invalid"
|
|
10685
|
+
},
|
|
10686
|
+
source: null,
|
|
10687
|
+
failure: attempt.omitProjectBecause
|
|
10688
|
+
};
|
|
10689
|
+
}
|
|
10690
|
+
const held = [];
|
|
10691
|
+
const loaded = loadConfigSource({
|
|
10692
|
+
filePath: paths.projectConfig,
|
|
10693
|
+
layer: "project",
|
|
10694
|
+
invalidSource: input.projectFailure === "throw" ? "throw" : "report",
|
|
10695
|
+
warningSink: (message) => {
|
|
10696
|
+
held.push(message);
|
|
10697
|
+
},
|
|
10698
|
+
reportInvalid: (filePath, _code, reason) => noticeSkippedProjectConfig(filePath, reason, attempt.warningSink),
|
|
10699
|
+
allowProjectProfiles: input.allowProjectProfiles,
|
|
10700
|
+
projectAllowed: input.projectAllowed
|
|
10701
|
+
});
|
|
10702
|
+
if (loaded.source !== null) {
|
|
10703
|
+
for (const message of held)
|
|
10704
|
+
input.stripSink(message);
|
|
10705
|
+
}
|
|
10706
|
+
return loaded;
|
|
10707
|
+
}
|
|
10543
10708
|
function mergeUserLevelSearch(userLevel) {
|
|
10544
10709
|
return mergeSearchSettings(["user", "userLocal", "custom", "customLocal"].flatMap((slot) => {
|
|
10545
10710
|
const source = userLevel[slot].source;
|
package/dist/index.js
CHANGED
package/dist/lib/config.d.ts
CHANGED
|
@@ -158,6 +158,16 @@ export interface SourceAwareConfigResult {
|
|
|
158
158
|
* for a symlinked config directory.
|
|
159
159
|
*/
|
|
160
160
|
activeProfileSourcePath: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Set when the project config file was not loaded because it failed, on its
|
|
163
|
+
* own or in combination with the other layers. `reason` holds no value and no
|
|
164
|
+
* file content. Deliberately not on `ConfigObservationMetadata`, for the same
|
|
165
|
+
* reason as `activeProfileSourcePath`.
|
|
166
|
+
*/
|
|
167
|
+
skippedProject?: {
|
|
168
|
+
readonly path: string;
|
|
169
|
+
readonly reason: string;
|
|
170
|
+
};
|
|
161
171
|
}
|
|
162
172
|
export interface PiSubagentsOverlayMap {
|
|
163
173
|
categories?: OverlayConfigMap;
|
|
@@ -214,13 +224,35 @@ export interface LoadConfigOptions {
|
|
|
214
224
|
* start directory (see `getConfigPaths`).
|
|
215
225
|
*/
|
|
216
226
|
includeProject?: boolean;
|
|
227
|
+
/** What a failing user, user.local, custom or custom.local file does. Defaults to `throw`. The project file follows `projectFailure`. */
|
|
217
228
|
invalidSource?: 'throw' | 'report';
|
|
229
|
+
/**
|
|
230
|
+
* What a failing project file does. `skip` (the default) leaves the file out
|
|
231
|
+
* with one warning, so a repository's config cannot take the plugin down.
|
|
232
|
+
* `throw` makes it fatal, for a caller that writes into the repository.
|
|
233
|
+
*/
|
|
234
|
+
projectFailure?: 'skip' | 'throw';
|
|
218
235
|
homeDir?: string;
|
|
219
236
|
userConfigDir?: string;
|
|
220
237
|
customConfigDir?: string | null;
|
|
221
238
|
warningSink?: (message: string) => void;
|
|
222
239
|
}
|
|
223
240
|
export declare function loadConfig(projectDir: string, options?: LoadConfigOptions): SystematicConfig;
|
|
241
|
+
/** Forget which skipped project files were reported. For tests. */
|
|
242
|
+
export declare function resetSkippedProjectConfigNotices(): void;
|
|
243
|
+
/**
|
|
244
|
+
* Load every config layer into one config.
|
|
245
|
+
*
|
|
246
|
+
* User, user.local, custom and custom.local files are strict: a broken one
|
|
247
|
+
* throws. The project file comes from a repository, so by default it never
|
|
248
|
+
* takes the plugin down. A file that fails on its own (it cannot be read,
|
|
249
|
+
* is over the size cap, is not valid JSONC, or fails the schema) is skipped
|
|
250
|
+
* with one warning. A project file that loads alone but breaks the load once
|
|
251
|
+
* merged with the other layers is skipped the same way: the load is retried
|
|
252
|
+
* without it, and the original error stands if the retry fails too.
|
|
253
|
+
* `projectFailure: 'throw'` makes any project failure fatal instead, for a
|
|
254
|
+
* caller that writes into the repository and must not act on a partial view.
|
|
255
|
+
*/
|
|
224
256
|
export declare function loadConfigWithSources(projectDir: string, options?: LoadConfigOptions): SourceAwareConfigResult;
|
|
225
257
|
/**
|
|
226
258
|
* Whether a bundled persona is disabled by config, for harnesses that filter
|
|
@@ -12,8 +12,10 @@ export interface FrontmatterResult<T = Record<string, unknown>> {
|
|
|
12
12
|
* returned verbatim as part of the block — callers that scan individual lines
|
|
13
13
|
* (e.g. parse-safety checks) must skip indented lines themselves.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* The closing `---` must be a whole line, matching {@link parseFrontmatter}: a
|
|
16
|
+
* value that merely contains or ends in `---` (`title: a---b`) cannot close the
|
|
17
|
+
* block. Handles LF and CRLF line endings. The closing `---` does not need a
|
|
18
|
+
* trailing newline (handles files that end immediately after the delimiter).
|
|
17
19
|
*/
|
|
18
20
|
export declare function extractFrontmatterBlock(content: string): string | null;
|
|
19
21
|
/**
|
package/dist/pi.js
CHANGED
|
@@ -11116,8 +11116,12 @@ function readSearchBlock(filePath, maxBytes) {
|
|
|
11116
11116
|
if (text.kind !== "text")
|
|
11117
11117
|
return text;
|
|
11118
11118
|
const content = text.content;
|
|
11119
|
+
if (maxBytes !== undefined && content.trim() === "")
|
|
11120
|
+
return { kind: "absent" };
|
|
11119
11121
|
const errors = [];
|
|
11120
|
-
const parsed = parseJsonc(content, errors
|
|
11122
|
+
const parsed = parseJsonc(content, errors, {
|
|
11123
|
+
allowTrailingComma: true
|
|
11124
|
+
});
|
|
11121
11125
|
const firstError = errors[0];
|
|
11122
11126
|
if (firstError) {
|
|
11123
11127
|
return {
|
|
@@ -13495,6 +13499,12 @@ function warnDroppedNames(dropped, field, warned, removalVersion, warningSink =
|
|
|
13495
13499
|
}
|
|
13496
13500
|
var OVERSIZED_FILE_REASON = `file is larger than ${MAX_PROJECT_CONFIG_BYTES / (1024 * 1024)} MB`;
|
|
13497
13501
|
var USER_LEVEL_CONFIG_MAX_BYTES = Number.POSITIVE_INFINITY;
|
|
13502
|
+
function configFileError(filePath, detail) {
|
|
13503
|
+
return Object.assign(new Error(`Invalid Systematic config in ${filePath}: ${detail}`), { detail });
|
|
13504
|
+
}
|
|
13505
|
+
function hasFailureDetail(error) {
|
|
13506
|
+
return error instanceof Error && typeof error.detail === "string";
|
|
13507
|
+
}
|
|
13498
13508
|
function readConfigText(filePath, maxBytes) {
|
|
13499
13509
|
const read = readBytesBounded(filePath, maxBytes);
|
|
13500
13510
|
switch (read.kind) {
|
|
@@ -13503,28 +13513,32 @@ function readConfigText(filePath, maxBytes) {
|
|
|
13503
13513
|
case "absent":
|
|
13504
13514
|
if (!configEntryExists(filePath))
|
|
13505
13515
|
return null;
|
|
13506
|
-
throw
|
|
13516
|
+
throw configFileError(filePath, "unable to read file");
|
|
13507
13517
|
case "too-large":
|
|
13508
|
-
throw
|
|
13518
|
+
throw configFileError(filePath, `unable to read file (${OVERSIZED_FILE_REASON})`);
|
|
13509
13519
|
case "not-regular":
|
|
13510
|
-
throw
|
|
13520
|
+
throw configFileError(filePath, "unable to read file (not a regular file)");
|
|
13511
13521
|
default:
|
|
13512
|
-
throw
|
|
13522
|
+
throw configFileError(filePath, "unable to read file");
|
|
13513
13523
|
}
|
|
13514
13524
|
}
|
|
13515
|
-
function loadJsoncFile(filePath, maxBytes) {
|
|
13525
|
+
function loadJsoncFile(filePath, maxBytes, emptyIsAbsent) {
|
|
13516
13526
|
const content = readConfigText(filePath, maxBytes);
|
|
13517
13527
|
if (content === null)
|
|
13518
13528
|
return null;
|
|
13529
|
+
if (emptyIsAbsent && content.trim() === "")
|
|
13530
|
+
return null;
|
|
13519
13531
|
const errors = [];
|
|
13520
|
-
const parsed = parseJsonc2(content, errors
|
|
13532
|
+
const parsed = parseJsonc2(content, errors, {
|
|
13533
|
+
allowTrailingComma: true
|
|
13534
|
+
});
|
|
13521
13535
|
if (errors.length > 0) {
|
|
13522
13536
|
const error = errors[0];
|
|
13523
13537
|
const message = error ? `${printParseErrorCode2(error.error)} at offset ${error.offset}` : "unknown parse error";
|
|
13524
|
-
throw
|
|
13538
|
+
throw configFileError(filePath, `JSONC parse error: ${message}`);
|
|
13525
13539
|
}
|
|
13526
13540
|
if (!isRecord3(parsed)) {
|
|
13527
|
-
throw
|
|
13541
|
+
throw configFileError(filePath, "root must be an object");
|
|
13528
13542
|
}
|
|
13529
13543
|
return parsed;
|
|
13530
13544
|
}
|
|
@@ -13625,7 +13639,7 @@ function loadConfigSource(input) {
|
|
|
13625
13639
|
} = input;
|
|
13626
13640
|
const trust = LAYER_TRUST[layer];
|
|
13627
13641
|
try {
|
|
13628
|
-
const rawConfig = loadJsoncFile(filePath, layer === "project" ? MAX_PROJECT_CONFIG_BYTES : USER_LEVEL_CONFIG_MAX_BYTES);
|
|
13642
|
+
const rawConfig = loadJsoncFile(filePath, layer === "project" ? MAX_PROJECT_CONFIG_BYTES : USER_LEVEL_CONFIG_MAX_BYTES, layer === "project");
|
|
13629
13643
|
if (!rawConfig) {
|
|
13630
13644
|
return {
|
|
13631
13645
|
metadata: { kind: trust, presence: "absent" },
|
|
@@ -13658,10 +13672,12 @@ function loadConfigSource(input) {
|
|
|
13658
13672
|
if (invalidSource === "throw")
|
|
13659
13673
|
throw error;
|
|
13660
13674
|
const errorCode = classifyConfigSourceError(error);
|
|
13661
|
-
|
|
13675
|
+
const reason = describeConfigSourceFailure(error, errorCode);
|
|
13676
|
+
input.reportInvalid(filePath, errorCode, reason);
|
|
13662
13677
|
return {
|
|
13663
13678
|
metadata: { errorCode, kind: trust, presence: "invalid" },
|
|
13664
|
-
source: null
|
|
13679
|
+
source: null,
|
|
13680
|
+
failure: reason
|
|
13665
13681
|
};
|
|
13666
13682
|
}
|
|
13667
13683
|
}
|
|
@@ -13693,6 +13709,61 @@ function classifyConfigSourceError(error) {
|
|
|
13693
13709
|
function isConfigSchemaError(error) {
|
|
13694
13710
|
return isRecord3(error) && error._tag === "ConfigSchemaError";
|
|
13695
13711
|
}
|
|
13712
|
+
function schemaDefinition(node) {
|
|
13713
|
+
if (!isRecord3(node))
|
|
13714
|
+
return;
|
|
13715
|
+
const internals = node._zod;
|
|
13716
|
+
const definition = isRecord3(internals) ? internals.def : node.def;
|
|
13717
|
+
return isRecord3(definition) ? definition : undefined;
|
|
13718
|
+
}
|
|
13719
|
+
function unwrapSchemaNode(node) {
|
|
13720
|
+
let current = node;
|
|
13721
|
+
for (let depth = 0;depth < 16; depth += 1) {
|
|
13722
|
+
const definition = schemaDefinition(current);
|
|
13723
|
+
if (definition === undefined)
|
|
13724
|
+
return current;
|
|
13725
|
+
const inner = definition.innerType ?? definition.in;
|
|
13726
|
+
if (inner === undefined)
|
|
13727
|
+
return current;
|
|
13728
|
+
current = inner;
|
|
13729
|
+
}
|
|
13730
|
+
return current;
|
|
13731
|
+
}
|
|
13732
|
+
function redactedSchemaPath(path, root) {
|
|
13733
|
+
const segments = [];
|
|
13734
|
+
let node = root;
|
|
13735
|
+
for (const segment of path) {
|
|
13736
|
+
const definition = schemaDefinition(unwrapSchemaNode(node));
|
|
13737
|
+
const shape = definition?.type === "object" ? definition.shape : undefined;
|
|
13738
|
+
if (isRecord3(shape) && Object.hasOwn(shape, String(segment))) {
|
|
13739
|
+
segments.push(String(segment));
|
|
13740
|
+
node = shape[String(segment)];
|
|
13741
|
+
} else if (definition?.type === "array") {
|
|
13742
|
+
segments.push("<index>");
|
|
13743
|
+
node = definition.element;
|
|
13744
|
+
} else {
|
|
13745
|
+
segments.push("<key>");
|
|
13746
|
+
node = definition?.type === "record" ? definition.valueType : undefined;
|
|
13747
|
+
}
|
|
13748
|
+
}
|
|
13749
|
+
return segments;
|
|
13750
|
+
}
|
|
13751
|
+
function describeConfigSourceFailure(error, code) {
|
|
13752
|
+
if (isConfigSchemaError(error)) {
|
|
13753
|
+
const [issue] = error.issues;
|
|
13754
|
+
if (issue === undefined)
|
|
13755
|
+
return "schema validation failed";
|
|
13756
|
+
const segments = redactedSchemaPath(issue.path, SystematicConfigSchema);
|
|
13757
|
+
const where = sanitizeDiagnosticText(segments.join("."));
|
|
13758
|
+
if (issue.code === "unrecognized_keys") {
|
|
13759
|
+
return segments.length === 0 ? "schema validation failed: unrecognized key at the top level" : `schema validation failed: unrecognized key under \`${where}\``;
|
|
13760
|
+
}
|
|
13761
|
+
return segments.length === 0 ? "schema validation failed" : `schema validation failed at \`${where}\``;
|
|
13762
|
+
}
|
|
13763
|
+
if (hasFailureDetail(error))
|
|
13764
|
+
return error.detail;
|
|
13765
|
+
return code;
|
|
13766
|
+
}
|
|
13696
13767
|
function resolveConfigSourcePath(filePath) {
|
|
13697
13768
|
try {
|
|
13698
13769
|
return fs10.realpathSync(filePath);
|
|
@@ -14010,6 +14081,15 @@ function createInvalidFileReporter(warningSink) {
|
|
|
14010
14081
|
warningSink(`[systematic] config file (${sanitizeDiagnosticText(filePath)}) is invalid (${code}) and was not loaded.`);
|
|
14011
14082
|
};
|
|
14012
14083
|
}
|
|
14084
|
+
var skippedProjectNotices = new Set;
|
|
14085
|
+
function noticeSkippedProjectConfig(filePath, reason, warningSink) {
|
|
14086
|
+
const identity = `${resolveConfigSourcePath(filePath)}\x00${reason}`;
|
|
14087
|
+
if (skippedProjectNotices.has(identity))
|
|
14088
|
+
return;
|
|
14089
|
+
skippedProjectNotices.add(identity);
|
|
14090
|
+
warningSink(`[systematic] project config (${sanitizeDiagnosticText(filePath)}) was skipped: ${reason}. None of its settings were loaded. Fix the file to apply them.`);
|
|
14091
|
+
}
|
|
14092
|
+
var PROJECT_CONFIG_MERGE_FAILURE_REASON = "it could not be combined with the other config layers";
|
|
14013
14093
|
function reassignLayer(loaded, layer) {
|
|
14014
14094
|
const trust = LAYER_TRUST[layer];
|
|
14015
14095
|
return {
|
|
@@ -14097,10 +14177,60 @@ function mergeBootstrap(sources) {
|
|
|
14097
14177
|
return merged;
|
|
14098
14178
|
}
|
|
14099
14179
|
function loadConfigWithSources(projectDir, options) {
|
|
14180
|
+
const warningSink = options?.warningSink ?? console.warn;
|
|
14181
|
+
if (!(options?.includeProject ?? true) || options?.projectFailure === "throw") {
|
|
14182
|
+
return loadConfigLayers(projectDir, options, {
|
|
14183
|
+
warningSink,
|
|
14184
|
+
projectContributed: false
|
|
14185
|
+
});
|
|
14186
|
+
}
|
|
14187
|
+
const held = [];
|
|
14188
|
+
const flush = (messages) => {
|
|
14189
|
+
for (const message of messages)
|
|
14190
|
+
warningSink(message);
|
|
14191
|
+
};
|
|
14192
|
+
const attempt = {
|
|
14193
|
+
warningSink: (message) => {
|
|
14194
|
+
held.push(message);
|
|
14195
|
+
},
|
|
14196
|
+
projectContributed: false
|
|
14197
|
+
};
|
|
14198
|
+
try {
|
|
14199
|
+
const result = loadConfigLayers(projectDir, options, attempt);
|
|
14200
|
+
flush(held);
|
|
14201
|
+
return result;
|
|
14202
|
+
} catch (error) {
|
|
14203
|
+
if (!attempt.projectContributed) {
|
|
14204
|
+
flush(held);
|
|
14205
|
+
throw error;
|
|
14206
|
+
}
|
|
14207
|
+
const retryHeld = [];
|
|
14208
|
+
let retried;
|
|
14209
|
+
try {
|
|
14210
|
+
retried = loadConfigLayers(projectDir, options, {
|
|
14211
|
+
warningSink: (message) => {
|
|
14212
|
+
retryHeld.push(message);
|
|
14213
|
+
},
|
|
14214
|
+
omitProjectBecause: PROJECT_CONFIG_MERGE_FAILURE_REASON,
|
|
14215
|
+
projectContributed: false
|
|
14216
|
+
});
|
|
14217
|
+
} catch {
|
|
14218
|
+
flush(held);
|
|
14219
|
+
throw error;
|
|
14220
|
+
}
|
|
14221
|
+
flush(retryHeld);
|
|
14222
|
+
if (retried.skippedProject) {
|
|
14223
|
+
noticeSkippedProjectConfig(retried.skippedProject.path, retried.skippedProject.reason, warningSink);
|
|
14224
|
+
}
|
|
14225
|
+
return retried;
|
|
14226
|
+
}
|
|
14227
|
+
}
|
|
14228
|
+
function loadConfigLayers(projectDir, options, attempt) {
|
|
14100
14229
|
const includeProject = options?.includeProject ?? true;
|
|
14101
14230
|
const invalidSource = options?.invalidSource ?? "throw";
|
|
14231
|
+
const projectFailure = options?.projectFailure ?? "skip";
|
|
14102
14232
|
const paths = getConfigPaths(projectDir, options);
|
|
14103
|
-
const warningSink =
|
|
14233
|
+
const warningSink = attempt.warningSink;
|
|
14104
14234
|
const reportInvalid = createInvalidFileReporter(warningSink);
|
|
14105
14235
|
if (includeProject)
|
|
14106
14236
|
emitProjectLocationWarnings(paths, warningSink);
|
|
@@ -14118,19 +14248,17 @@ function loadConfigWithSources(projectDir, options) {
|
|
|
14118
14248
|
const homeDir = resolveUserLevelConfigDirs(options).homeDir || os5.homedir();
|
|
14119
14249
|
const projectAllowed = () => isAllowedProject(resolveProjectIdentity(paths.projectRoot), mergedSearch.settings?.allow_project_sources ?? [], { homeDir });
|
|
14120
14250
|
const aliasLoaded = aliasedFiles.some(({ layer }) => userLevel[USER_LEVEL_SLOT[layer]].source !== null);
|
|
14121
|
-
const project =
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14251
|
+
const project = loadProjectSource({
|
|
14252
|
+
attempt,
|
|
14253
|
+
includeProject,
|
|
14254
|
+
paths,
|
|
14255
|
+
projectFailure,
|
|
14256
|
+
stripSink: boundedProjectStrip.sink,
|
|
14127
14257
|
allowProjectProfiles,
|
|
14128
14258
|
projectAllowed
|
|
14129
|
-
})
|
|
14130
|
-
metadata: { kind: "project", presence: "absent" },
|
|
14131
|
-
source: null
|
|
14132
|
-
};
|
|
14259
|
+
});
|
|
14133
14260
|
const projectSource = project.source;
|
|
14261
|
+
attempt.projectContributed = projectSource !== null;
|
|
14134
14262
|
emitTopLevelProtectedFieldWarning(projectSource, "profiles", `\`profiles\` in project config (%PATH%) is only valid in user config or OPENCODE_CONFIG_DIR config and has been ignored. Its bundles are not selectable even if this project also sets \`profile\`.`, boundedProjectStrip.sink);
|
|
14135
14263
|
emitTopLevelProtectedFieldWarning(projectSource, "allow_project_profiles", `\`allow_project_profiles\` in project config (%PATH%) is only valid in user config or OPENCODE_CONFIG_DIR config and has been ignored.`, boundedProjectStrip.sink);
|
|
14136
14264
|
emitProjectSearchProtectedWarnings(projectSource, boundedProjectStrip.sink);
|
|
@@ -14233,9 +14361,46 @@ function loadConfigWithSources(projectDir, options) {
|
|
|
14233
14361
|
}),
|
|
14234
14362
|
overlays,
|
|
14235
14363
|
piSubagentsOverlays: mergedPiSubagentsOverlays,
|
|
14236
|
-
activeProfileSourcePath: profileSelection.bundleSource?.path ?? null
|
|
14364
|
+
activeProfileSourcePath: profileSelection.bundleSource?.path ?? null,
|
|
14365
|
+
...project.failure !== undefined && {
|
|
14366
|
+
skippedProject: { path: paths.projectConfig, reason: project.failure }
|
|
14367
|
+
}
|
|
14237
14368
|
};
|
|
14238
14369
|
}
|
|
14370
|
+
function loadProjectSource(input) {
|
|
14371
|
+
const { attempt, paths } = input;
|
|
14372
|
+
if (!input.includeProject) {
|
|
14373
|
+
return { metadata: { kind: "project", presence: "absent" }, source: null };
|
|
14374
|
+
}
|
|
14375
|
+
if (attempt.omitProjectBecause !== undefined) {
|
|
14376
|
+
return {
|
|
14377
|
+
metadata: {
|
|
14378
|
+
errorCode: "source-invalid",
|
|
14379
|
+
kind: "project",
|
|
14380
|
+
presence: "invalid"
|
|
14381
|
+
},
|
|
14382
|
+
source: null,
|
|
14383
|
+
failure: attempt.omitProjectBecause
|
|
14384
|
+
};
|
|
14385
|
+
}
|
|
14386
|
+
const held = [];
|
|
14387
|
+
const loaded = loadConfigSource({
|
|
14388
|
+
filePath: paths.projectConfig,
|
|
14389
|
+
layer: "project",
|
|
14390
|
+
invalidSource: input.projectFailure === "throw" ? "throw" : "report",
|
|
14391
|
+
warningSink: (message) => {
|
|
14392
|
+
held.push(message);
|
|
14393
|
+
},
|
|
14394
|
+
reportInvalid: (filePath, _code, reason) => noticeSkippedProjectConfig(filePath, reason, attempt.warningSink),
|
|
14395
|
+
allowProjectProfiles: input.allowProjectProfiles,
|
|
14396
|
+
projectAllowed: input.projectAllowed
|
|
14397
|
+
});
|
|
14398
|
+
if (loaded.source !== null) {
|
|
14399
|
+
for (const message of held)
|
|
14400
|
+
input.stripSink(message);
|
|
14401
|
+
}
|
|
14402
|
+
return loaded;
|
|
14403
|
+
}
|
|
14239
14404
|
function mergeUserLevelSearch(userLevel) {
|
|
14240
14405
|
return mergeSearchSettings(["user", "userLocal", "custom", "customLocal"].flatMap((slot) => {
|
|
14241
14406
|
const source = userLevel[slot].source;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-native-architecture
|
|
3
3
|
description: Build applications where agents are first-class citizens. Use this skill when designing autonomous agents, creating MCP tools, implementing self-modifying systems, or building apps where features are outcomes achieved by agents operating in a loop.
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
<why_now>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ce:brainstorm
|
|
3
3
|
description: 'Explore requirements and approaches through collaborative dialogue before writing a right-sized requirements document and planning implementation. Use for feature ideas, problem framing, when the user says ''let''s brainstorm'', or when they want to think through options before deciding what to build. Also use when a user describes a vague or ambitious feature request, asks ''what should we build'', ''help me think through X'', presents a problem with multiple valid solutions, or seems unsure about scope or direction — even if they don''t explicitly ask to brainstorm.'
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[feature idea or problem to explore]"
|
|
5
6
|
metadata:
|
|
6
7
|
harness-portability: neutral-v1
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ce:compound-refresh
|
|
3
3
|
description: Refresh stale or drifting learnings and pattern docs in docs/solutions/ by reviewing, updating, consolidating, replacing, or deleting them against the current codebase. Use after refactors, migrations, dependency upgrades, or when a retrieved learning feels outdated or wrong. Also use when reviewing docs/solutions/ for accuracy, when a recently solved problem contradicts an existing learning, when pattern docs no longer reflect current code, or when multiple docs seem to cover the same topic and might benefit from consolidation.
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[mode:autofix] [optional: category, module, or keyword scope]"
|
|
5
6
|
disable-model-invocation: true
|
|
6
7
|
---
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ce:ideate
|
|
3
3
|
description: "Generate and critically evaluate grounded improvement ideas for the current project. Use when asking what to improve, requesting idea generation, exploring surprising improvements, or wanting the AI to proactively suggest strong project directions before brainstorming one in depth. Triggers on phrases like 'what should I improve', 'give me ideas', 'ideate on this project', 'surprise me with improvements', 'what would you change', or any request for AI-generated project improvement suggestions rather than refining the user's own idea."
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[feature, focus area, or constraint]"
|
|
5
6
|
metadata:
|
|
6
7
|
harness-portability: neutral-v1
|
package/skills/ce-plan/SKILL.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ce:plan
|
|
3
3
|
description: "Create structured plans for any multi-step task -- software features, research workflows, events, study plans, or any goal that benefits from structured breakdown. Also deepen existing plans with interactive review of sub-agent findings. Use for plan creation when the user says 'plan this', 'create a plan', 'write a tech plan', 'plan the implementation', 'how should we build', 'what's the approach for', 'break this down', 'plan a trip', 'create a study plan', or when a brainstorm/requirements document is ready for planning. Use for plan deepening when the user says 'deepen the plan', 'deepen my plan', 'deepening pass', or uses 'deepen' in reference to a plan."
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[optional: feature description, requirements doc path, plan path to deepen, or any task to plan]"
|
|
5
6
|
metadata:
|
|
6
7
|
harness-portability: neutral-v1
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ce:review
|
|
3
3
|
description: "Structured code review using tiered persona agents, confidence-gated findings, and a merge/dedup pipeline. Use when reviewing code changes before creating a PR."
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[blank to review current branch, or provide PR link]"
|
|
5
6
|
metadata:
|
|
6
7
|
harness-portability: neutral-v1
|
package/skills/ce-work/SKILL.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deepen-plan
|
|
3
3
|
description: Stress-test an existing implementation plan and selectively strengthen weak sections with targeted research. Use when a plan needs more confidence around decisions, sequencing, system-wide impact, risks, or verification. Best for Standard or Deep plans, or high-risk topics such as auth, payments, migrations, external APIs, and security. For structural or clarity improvements, prefer document-review instead.
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: '[path to plan file]'
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: document-review
|
|
3
3
|
description: Review requirements or plan documents using parallel persona agents that surface role-specific issues. Use when a requirements document or plan document exists and the user wants to improve it.
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[mode:headless] [path/to/document.md]"
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-clean-gone-branches
|
|
3
3
|
description: Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated worktrees for branches that have them.
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Clean Gone Branches
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-commit
|
|
3
3
|
description: Create a git commit with a clear, value-communicating message. Use when the user says "commit", "commit this", "save my changes", "create a commit", or wants to commit staged or unstaged work. Produces well-structured commit messages that follow repo conventions when they exist, and defaults to conventional commit format otherwise.
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Git Commit
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-commit-push-pr
|
|
3
3
|
description: Commit, push, and open a PR with an adaptive, value-first description. Use when the user says "commit and PR", "push and open a PR", "ship this", "create a PR", "open a pull request", "commit push PR", or wants to go from working changes to an open pull request in one step. Also use when the user says "update the PR description", "refresh the PR description", "freshen the PR", or wants to rewrite an existing PR description. Produces PR descriptions that scale in depth with the complexity of the change, avoiding cookie-cutter templates.
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Git Commit, Push, and PR
|
package/skills/lfg/SKILL.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: onboarding
|
|
3
3
|
description: "Generate or regenerate ONBOARDING.md to help new contributors understand a codebase. Use when the user asks to 'create onboarding docs', 'generate ONBOARDING.md', 'document this project for new developers', 'write onboarding documentation', 'vonboard', 'vonboarding', 'prepare this repo for a new contributor', 'refresh the onboarding doc', or 'update ONBOARDING.md'. Also use when someone needs to onboard a new team member and wants a written artifact, or when a codebase lacks onboarding documentation and the user wants to generate one."
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Generate Onboarding Document
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: report-bug-ce
|
|
3
3
|
description: Use this skill when a user needs to report a bug in the Systematic plugin with complete reproduction details and environment data, then open a GitHub issue directly from the CLI.
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: '[optional: brief description of the bug]'
|
|
5
6
|
disable-model-invocation: true
|
|
6
7
|
---
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reproduce-bug
|
|
3
3
|
description: Systematically reproduce and investigate a bug from a GitHub issue. Use when the user provides a GitHub issue number or URL for a bug they want reproduced or investigated.
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: '[GitHub issue number or URL]'
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: resolve-pr-feedback
|
|
3
3
|
description: Resolve PR review feedback by evaluating validity and fixing issues in parallel. Use when addressing PR review comments, resolving review threads, or fixing code review feedback.
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[PR number, comment URL, or blank for current branch's PR]"
|
|
5
6
|
allowed-tools: Bash(gh *), Bash(git *), Read
|
|
6
7
|
---
|
package/skills/slfg/SKILL.md
CHANGED
package/skills/todos/SKILL.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: todos
|
|
3
3
|
description: Use when creating durable work items, managing todo lifecycle, or tracking findings across sessions in the file-based todo system; when reviewing pending todos for approval, prioritizing code review findings, or interactively categorizing work items; or when batch-resolving approved todos, especially after code review or triage sessions
|
|
4
|
+
license: MIT
|
|
4
5
|
argument-hint: "[create|triage|resolve] [optional: findings list, source type, or specific todo ID/pattern]"
|
|
5
6
|
disable-model-invocation: true
|
|
6
7
|
---
|