@peterxiaoyang/superspec 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.
Files changed (68) hide show
  1. package/README.md +47 -0
  2. package/adapters/codex/agents/architect.toml +157 -0
  3. package/adapters/codex/agents/code-reviewer.toml +175 -0
  4. package/adapters/codex/agents/critic.toml +114 -0
  5. package/adapters/codex/agents/test-engineer.toml +163 -0
  6. package/adapters/codex/agents/verifier.toml +119 -0
  7. package/adapters/codex/install-map.json +81 -0
  8. package/bin/launch.js +37 -0
  9. package/bin/superspec-guard.js +4 -0
  10. package/bin/superspec-init.js +4 -0
  11. package/bin/superspec.js +4 -0
  12. package/dist/src/archive.d.ts +23 -0
  13. package/dist/src/archive.js +428 -0
  14. package/dist/src/cli.d.ts +1 -0
  15. package/dist/src/cli.js +20 -0
  16. package/dist/src/cli_args.d.ts +12 -0
  17. package/dist/src/cli_args.js +146 -0
  18. package/dist/src/core.d.ts +19 -0
  19. package/dist/src/core.js +357 -0
  20. package/dist/src/disclosure.d.ts +35 -0
  21. package/dist/src/disclosure.js +671 -0
  22. package/dist/src/evidence.d.ts +28 -0
  23. package/dist/src/evidence.js +849 -0
  24. package/dist/src/gates.d.ts +16 -0
  25. package/dist/src/gates.js +1470 -0
  26. package/dist/src/git.d.ts +8 -0
  27. package/dist/src/git.js +112 -0
  28. package/dist/src/init_cli.d.ts +2 -0
  29. package/dist/src/init_cli.js +145 -0
  30. package/dist/src/install_engine.d.ts +54 -0
  31. package/dist/src/install_engine.js +351 -0
  32. package/dist/src/invariants.d.ts +16 -0
  33. package/dist/src/invariants.js +363 -0
  34. package/dist/src/openspec.d.ts +18 -0
  35. package/dist/src/openspec.js +157 -0
  36. package/dist/src/paths.d.ts +22 -0
  37. package/dist/src/paths.js +203 -0
  38. package/dist/src/project_init.d.ts +4 -0
  39. package/dist/src/project_init.js +161 -0
  40. package/dist/src/state.d.ts +37 -0
  41. package/dist/src/state.js +464 -0
  42. package/dist/src/tasks.d.ts +23 -0
  43. package/dist/src/tasks.js +225 -0
  44. package/dist/src/util.d.ts +120 -0
  45. package/dist/src/util.js +442 -0
  46. package/dist/superspec.d.ts +4 -0
  47. package/dist/superspec.js +57 -0
  48. package/dist/superspec_guard.d.ts +4 -0
  49. package/dist/superspec_guard.js +19 -0
  50. package/dist/superspec_init.d.ts +2 -0
  51. package/dist/superspec_init.js +17 -0
  52. package/package.json +63 -0
  53. package/schemas/install-manifest.schema.json +80 -0
  54. package/templates/sidecar/archive-preservation.json +11 -0
  55. package/templates/sidecar/business-invariants.md +38 -0
  56. package/templates/sidecar/config.yaml +13 -0
  57. package/templates/sidecar/discovery.md +24 -0
  58. package/templates/sidecar/test-contract.md +26 -0
  59. package/templates/workflow/prompts/architect.md +113 -0
  60. package/templates/workflow/prompts/code-reviewer.md +141 -0
  61. package/templates/workflow/prompts/critic.md +80 -0
  62. package/templates/workflow/prompts/test-engineer.md +130 -0
  63. package/templates/workflow/prompts/verifier.md +85 -0
  64. package/templates/workflow/skills/superspec-apply/SKILL.md +72 -0
  65. package/templates/workflow/skills/superspec-archive/SKILL.md +41 -0
  66. package/templates/workflow/skills/superspec-explore/SKILL.md +70 -0
  67. package/templates/workflow/skills/superspec-propose/SKILL.md +79 -0
  68. package/templates/workflow/skills/superspec-review/SKILL.md +237 -0
@@ -0,0 +1,119 @@
1
+ # oh-my-codex agent: verifier
2
+ name = "verifier"
3
+ description = "Completion evidence, claim validation, test adequacy"
4
+ model_reasoning_effort = "xhigh"
5
+ developer_instructions = """
6
+ <identity>
7
+ You are Verifier. Prove or disprove completion with direct evidence.
8
+ </identity>
9
+
10
+ <goal>
11
+ Turn claims into reproducible proof or proof gaps by checking code, diffs, commands, diagnostics, tests, artifacts, and acceptance criteria. Missing evidence is a gap, not a pass, and the main thread remains responsible for final adjudication.
12
+ </goal>
13
+
14
+ <constraints>
15
+ <scope_guard>
16
+ - Verify claims against observable evidence; do not trust implementation summaries.
17
+ - Distinguish failed behavior from unavailable or missing proof.
18
+ - Prefer fresh command output when available.
19
+ </scope_guard>
20
+
21
+ <ask_gate>
22
+ <!-- OMX:GUIDANCE:VERIFIER:CONSTRAINTS:START -->
23
+ - Default reports to outcome-first, evidence-dense verdicts: name the claim, success criteria, validation evidence, gaps, and stop condition before adding process detail.
24
+ - Keep collaboration style direct and concise; do not expand verification scope beyond what materially proves or disproves the claim.
25
+ - For multi-step verification, start with a concise preamble that names the first check; keep intermediate updates brief and evidence-based.
26
+ - AUTO-CONTINUE for clear, already-requested, low-risk, reversible, local inspect-test-verify work; keep inspecting, testing, and verifying without permission handoff.
27
+ - ASK only for destructive, irreversible, credential-gated, external-production, or materially scope-changing actions, or when missing authority blocks progress.
28
+ - On AUTO-CONTINUE branches, do not use permission-handoff phrasing; state the next verification action or evidence-backed verdict.
29
+ - Use absolute language only for true invariants: safety, security, side-effect boundaries, required output fields, workflow state transitions, and product contracts.
30
+ - Keep gathering evidence until the verdict is grounded or blocked by a missing acceptance target or unavailable proof source.
31
+ - If correctness depends on additional tests, diagnostics, or inspection, keep using those tools until the verdict is grounded; stop once enough evidence proves the core claim.
32
+ - More verification effort does not mean unrelated tool churn; gather the proof that matters, not every possible artifact.
33
+ <!-- OMX:GUIDANCE:VERIFIER:CONSTRAINTS:END -->
34
+ - Ask only when the acceptance target is materially unclear and cannot be derived from repo or task history.
35
+ </ask_gate>
36
+ </constraints>
37
+
38
+ <execution_loop>
39
+ 1. State what must be proven.
40
+ 2. Inspect relevant files, diffs, outputs, and artifacts.
41
+ 3. Run or review the commands that directly prove the claim.
42
+ 4. Report proof status, evidence, gaps, risks, and any blocked proof source.
43
+ </execution_loop>
44
+
45
+ <success_criteria>
46
+ - Acceptance criteria are checked directly.
47
+ - Evidence is concrete and reproducible.
48
+ - Missing proof is called out explicitly.
49
+ - The verdict is grounded and actionable.
50
+ </success_criteria>
51
+
52
+ <verification_loop>
53
+ <!-- OMX:GUIDANCE:VERIFIER:INVESTIGATION:START -->
54
+ 5) If a newer user instruction only changes the current verification target or report shape, apply that override locally without discarding earlier non-conflicting acceptance criteria; preserve traceability from each claim to evidence, validation command, or explicit proof gap.
55
+ <!-- OMX:GUIDANCE:VERIFIER:INVESTIGATION:END -->
56
+ Keep gathering the required evidence until the verdict is grounded or the proof source is unavailable.
57
+ </verification_loop>
58
+
59
+ <tools>
60
+ Use Read/Grep/Glob for evidence, diagnostics/test/build commands for behavior, and diff/history inspection when scope depends on recent changes.
61
+ </tools>
62
+
63
+ <style>
64
+ <output_contract>
65
+ ## Verdict
66
+ - PASS / FAIL / PARTIAL
67
+
68
+ ## Evidence
69
+ - `command or artifact` — result
70
+
71
+ ## Gaps
72
+ - Missing or inconclusive proof
73
+
74
+ ## Risks
75
+ - Remaining uncertainty or follow-up needed
76
+ </output_contract>
77
+
78
+ <scenario_handling>
79
+ - If the user says `continue`, keep gathering the required evidence instead of restating a partial verdict.
80
+ - If the user says `merge if CI green`, check relevant statuses, confirm they are green, and report the gate outcome.
81
+ </scenario_handling>
82
+
83
+ <stop_rules>
84
+ Stop only when the verdict is evidence-backed or the needed proof source/authority is unavailable.
85
+ </stop_rules>
86
+ </style>
87
+
88
+ <posture_overlay>
89
+
90
+ You are operating in the frontier-orchestrator posture.
91
+ - Prioritize intent classification before implementation.
92
+ - Default to delegation and orchestration when specialists exist.
93
+ - Treat the first decision as a routing problem: research vs planning vs implementation vs verification.
94
+ - Challenge flawed user assumptions concisely before execution when the design is likely to cause avoidable problems.
95
+ - Preserve explicit executor handoff boundaries: do not absorb deep implementation work when a specialized executor is more appropriate.
96
+
97
+ </posture_overlay>
98
+
99
+ <model_class_guidance>
100
+
101
+ This role is tuned for standard-capability models.
102
+ - Balance autonomy with clear boundaries.
103
+ - Prefer explicit verification and narrow scope control over speculative reasoning.
104
+
105
+ </model_class_guidance>
106
+
107
+ <native_subagent_leaf_guard>
108
+
109
+ Leaf native subagent: do not call Task, spawn_agent, or native child agents.
110
+ Use local tools; report missing specialist coverage to the leader.
111
+
112
+ </native_subagent_leaf_guard>
113
+
114
+ ## OMX Agent Metadata
115
+ - role: verifier
116
+ - posture: frontier-orchestrator
117
+ - model_class: standard
118
+ - routing_role: leader
119
+ """
@@ -0,0 +1,81 @@
1
+ {
2
+ "adapter": "codex",
3
+ "version": 1,
4
+ "mappings": [
5
+ {
6
+ "kind": "skill",
7
+ "source": "templates/workflow/skills/superspec-explore/SKILL.md",
8
+ "target": ".codex/skills/superspec-explore/SKILL.md"
9
+ },
10
+ {
11
+ "kind": "skill",
12
+ "source": "templates/workflow/skills/superspec-propose/SKILL.md",
13
+ "target": ".codex/skills/superspec-propose/SKILL.md"
14
+ },
15
+ {
16
+ "kind": "skill",
17
+ "source": "templates/workflow/skills/superspec-apply/SKILL.md",
18
+ "target": ".codex/skills/superspec-apply/SKILL.md"
19
+ },
20
+ {
21
+ "kind": "skill",
22
+ "source": "templates/workflow/skills/superspec-review/SKILL.md",
23
+ "target": ".codex/skills/superspec-review/SKILL.md"
24
+ },
25
+ {
26
+ "kind": "skill",
27
+ "source": "templates/workflow/skills/superspec-archive/SKILL.md",
28
+ "target": ".codex/skills/superspec-archive/SKILL.md"
29
+ },
30
+ {
31
+ "kind": "prompt",
32
+ "source": "templates/workflow/prompts/architect.md",
33
+ "target": ".codex/prompts/architect.md"
34
+ },
35
+ {
36
+ "kind": "prompt",
37
+ "source": "templates/workflow/prompts/code-reviewer.md",
38
+ "target": ".codex/prompts/code-reviewer.md"
39
+ },
40
+ {
41
+ "kind": "prompt",
42
+ "source": "templates/workflow/prompts/critic.md",
43
+ "target": ".codex/prompts/critic.md"
44
+ },
45
+ {
46
+ "kind": "prompt",
47
+ "source": "templates/workflow/prompts/test-engineer.md",
48
+ "target": ".codex/prompts/test-engineer.md"
49
+ },
50
+ {
51
+ "kind": "prompt",
52
+ "source": "templates/workflow/prompts/verifier.md",
53
+ "target": ".codex/prompts/verifier.md"
54
+ },
55
+ {
56
+ "kind": "agent",
57
+ "source": "adapters/codex/agents/architect.toml",
58
+ "target": ".codex/agents/architect.toml"
59
+ },
60
+ {
61
+ "kind": "agent",
62
+ "source": "adapters/codex/agents/code-reviewer.toml",
63
+ "target": ".codex/agents/code-reviewer.toml"
64
+ },
65
+ {
66
+ "kind": "agent",
67
+ "source": "adapters/codex/agents/critic.toml",
68
+ "target": ".codex/agents/critic.toml"
69
+ },
70
+ {
71
+ "kind": "agent",
72
+ "source": "adapters/codex/agents/test-engineer.toml",
73
+ "target": ".codex/agents/test-engineer.toml"
74
+ },
75
+ {
76
+ "kind": "agent",
77
+ "source": "adapters/codex/agents/verifier.toml",
78
+ "target": ".codex/agents/verifier.toml"
79
+ }
80
+ ]
81
+ }
package/bin/launch.js ADDED
@@ -0,0 +1,37 @@
1
+ export const REQUIRED_NODE_VERSION = "20.19.0";
2
+ const REQUIRED_NODE_PARTS = REQUIRED_NODE_VERSION.split(".").map((part) => Number.parseInt(part, 10));
3
+
4
+ function compareNodeVersion(version) {
5
+ const parts = String(version).split(".").map((part) => Number.parseInt(part, 10));
6
+ for (let index = 0; index < REQUIRED_NODE_PARTS.length; index += 1) {
7
+ const actual = parts[index] ?? 0;
8
+ const required = REQUIRED_NODE_PARTS[index] ?? 0;
9
+ if (!Number.isFinite(actual)) return -1;
10
+ if (actual > required) return 1;
11
+ if (actual < required) return -1;
12
+ }
13
+ return 0;
14
+ }
15
+
16
+ export function nodeVersionError(version = process.versions.node) {
17
+ if (compareNodeVersion(version) >= 0) return null;
18
+ return `SuperSpec requires Node.js >=${REQUIRED_NODE_VERSION}. Current Node.js is ${version}. Upgrade Node.js, then rerun the command.`;
19
+ }
20
+
21
+ export function assertSupportedNode(version = process.versions.node) {
22
+ const message = nodeVersionError(version);
23
+ if (message === null) return;
24
+ console.error(message);
25
+ process.exit(1);
26
+ }
27
+
28
+ export async function runEntry(entryPath, exportName, argv = process.argv.slice(2)) {
29
+ assertSupportedNode();
30
+ const mod = await import(new URL(entryPath, import.meta.url).href);
31
+ const main = mod[exportName];
32
+ if (typeof main !== "function") {
33
+ console.error(`SuperSpec internal error: ${entryPath} does not export ${exportName}`);
34
+ process.exit(2);
35
+ }
36
+ process.exitCode = await main(argv);
37
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runEntry } from "./launch.js";
3
+
4
+ await runEntry("../dist/superspec_guard.js", "main");
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runEntry } from "./launch.js";
3
+
4
+ await runEntry("../dist/superspec_init.js", "main_init_async");
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runEntry } from "./launch.js";
3
+
4
+ await runEntry("../dist/superspec.js", "main_superspec");
@@ -0,0 +1,23 @@
1
+ import type { Decision, JsonMap, Reason } from "./util.ts";
2
+ export declare function archive_manifest_path(changeRoot: string): string;
3
+ export declare function archive_preservation_dir(changeRoot: string): string;
4
+ export declare function archive_preservation_manifest_path(changeRoot: string): string;
5
+ export declare function sidecar_manifest_entries(changeRoot: string): JsonMap[];
6
+ export declare function write_archive_manifest(change: string, changeRoot: string): string;
7
+ export declare function begin_archive_preservation_bundle(change: string, changeRoot: string, opts?: {
8
+ file_overrides?: Record<string, string>;
9
+ }): {
10
+ manifest_path: string;
11
+ bundle_manifest_path: string;
12
+ commit: () => void;
13
+ rollback: () => void;
14
+ };
15
+ export declare function write_archive_preservation_bundle(change: string, changeRoot: string, opts?: {
16
+ file_overrides?: Record<string, string>;
17
+ }): string;
18
+ export declare function find_archived_change(repoRoot: string, change: string): string | null;
19
+ export declare function check_archived(change: string, repoRoot: string): Decision;
20
+ export declare function check_archived_preservation_bundle(change: string, archived: string, manifestPath: string): Decision;
21
+ export declare function preset_upgrade_required(preset: string, changedPaths: string[], flags?: JsonMap): boolean;
22
+ export declare function preset_upgrade_reasons(config: JsonMap, changedPaths: string[], humanConfirmed?: boolean, flags?: JsonMap): Reason[];
23
+ export declare function preset_upgrade_required_from_context(config: JsonMap, changedPaths: string[]): boolean;