minimal-vibe-coding-kit 0.3.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 (223) hide show
  1. package/.agents/skills/agentshield-security-review/SKILL.md +75 -0
  2. package/.agents/skills/agentshield-security-review/agents/openai.yaml +5 -0
  3. package/.agents/skills/agentshield-security-review/references/native-install.md +97 -0
  4. package/.agents/skills/agentshield-security-review/references/report-template.md +54 -0
  5. package/.agents/skills/agentshield-security-review/references/review-checklist.md +45 -0
  6. package/.agents/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +110 -0
  7. package/.agents/skills/autoresearch-coding/README.md +15 -0
  8. package/.agents/skills/autoresearch-coding/SKILL.md +101 -0
  9. package/.agents/skills/autoresearch-coding/references/experiment-contract.md +13 -0
  10. package/.agents/skills/autoresearch-coding/references/metric-extraction.md +8 -0
  11. package/.agents/skills/autoresearch-coding/references/result-ledger.md +15 -0
  12. package/.agents/skills/autoresearch-coding/scripts/log_result.py +24 -0
  13. package/.agents/skills/autoresearch-coding/scripts/run_logged.py +30 -0
  14. package/.agents/skills/clearthought/SKILL.md +100 -0
  15. package/.agents/skills/clearthought/examples/decision-framework.md +441 -0
  16. package/.agents/skills/clearthought/examples/metagame-examples.md +536 -0
  17. package/.agents/skills/clearthought/examples/sequential-thinking.md +380 -0
  18. package/.agents/skills/clearthought/references/output-schemas.md +494 -0
  19. package/.agents/skills/clearthought/references/parameter-reference.md +482 -0
  20. package/.agents/skills/coding-level/SKILL.md +27 -0
  21. package/.agents/skills/coding-level/references/level-0.md +131 -0
  22. package/.agents/skills/coding-level/references/level-1.md +118 -0
  23. package/.agents/skills/coding-level/references/level-2.md +140 -0
  24. package/.agents/skills/coding-level/references/level-3.md +142 -0
  25. package/.agents/skills/coding-level/references/level-4.md +152 -0
  26. package/.agents/skills/coding-level/references/level-5.md +84 -0
  27. package/.agents/skills/daily-workflow-curator/SKILL.md +52 -0
  28. package/.agents/skills/memento/SKILL.md +36 -0
  29. package/.agents/skills/reviewing-4p-priorities/SKILL.md +72 -0
  30. package/.agents/skills/reviewing-4p-priorities/examples.md +298 -0
  31. package/.agents/skills/sequential-thinking/SKILL.md +106 -0
  32. package/.agents/skills/sequential-thinking/examples/adaptive-depth.md +542 -0
  33. package/.agents/skills/sequential-thinking/examples/branching-exploration.md +474 -0
  34. package/.agents/skills/sequential-thinking/examples/linear-reasoning.md +210 -0
  35. package/.agents/skills/sequential-thinking/examples/revision-pattern.md +304 -0
  36. package/.agents/skills/sequential-thinking/references/output-schema.md +483 -0
  37. package/.agents/skills/sequential-thinking/references/parameters.md +463 -0
  38. package/.agents/skills/sequential-thinking/references/patterns.md +666 -0
  39. package/.agents/skills/vibekit-init/SKILL.md +52 -0
  40. package/.agents/skills/visual-design-loop/SKILL.md +103 -0
  41. package/.agents/skills/visual-design-loop/agents/openai.yaml +4 -0
  42. package/.claude/agents/code-reviewer.md +11 -0
  43. package/.claude/agents/context-architect.md +11 -0
  44. package/.claude/agents/debug-fixer.md +11 -0
  45. package/.claude/agents/hypothesis-planner.md +11 -0
  46. package/.claude/agents/implementation-hacker.md +11 -0
  47. package/.claude/agents/research-coordinator.md +11 -0
  48. package/.claude/agents/results-analyst.md +11 -0
  49. package/.claude/agents/security-reviewer.md +11 -0
  50. package/.claude/agents/test-runner.md +11 -0
  51. package/.claude/agents/workflow-curator.md +11 -0
  52. package/.claude/commands/autoresearch-coding.md +15 -0
  53. package/.claude/commands/council.md +7 -0
  54. package/.claude/commands/daily-enhance.md +7 -0
  55. package/.claude/commands/init-vibe.md +7 -0
  56. package/.claude/commands/security-scan.md +7 -0
  57. package/.claude/commands/vibe-finalize.md +7 -0
  58. package/.claude/rules/autoresearch.md +3 -0
  59. package/.claude/rules/security.md +3 -0
  60. package/.claude/rules/tooling.md +6 -0
  61. package/.claude/rules/vibe-core.md +8 -0
  62. package/.claude/settings.json +22 -0
  63. package/.claude/skills/agentshield-security-review/SKILL.md +75 -0
  64. package/.claude/skills/agentshield-security-review/agents/openai.yaml +5 -0
  65. package/.claude/skills/agentshield-security-review/references/native-install.md +97 -0
  66. package/.claude/skills/agentshield-security-review/references/report-template.md +54 -0
  67. package/.claude/skills/agentshield-security-review/references/review-checklist.md +45 -0
  68. package/.claude/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +110 -0
  69. package/.claude/skills/autoresearch-coding/README.md +15 -0
  70. package/.claude/skills/autoresearch-coding/SKILL.md +101 -0
  71. package/.claude/skills/autoresearch-coding/references/experiment-contract.md +13 -0
  72. package/.claude/skills/autoresearch-coding/references/metric-extraction.md +8 -0
  73. package/.claude/skills/autoresearch-coding/references/result-ledger.md +15 -0
  74. package/.claude/skills/autoresearch-coding/scripts/log_result.py +24 -0
  75. package/.claude/skills/autoresearch-coding/scripts/run_logged.py +30 -0
  76. package/.claude/skills/clearthought/SKILL.md +100 -0
  77. package/.claude/skills/clearthought/examples/decision-framework.md +441 -0
  78. package/.claude/skills/clearthought/examples/metagame-examples.md +536 -0
  79. package/.claude/skills/clearthought/examples/sequential-thinking.md +380 -0
  80. package/.claude/skills/clearthought/references/output-schemas.md +494 -0
  81. package/.claude/skills/clearthought/references/parameter-reference.md +482 -0
  82. package/.claude/skills/coding-level/SKILL.md +27 -0
  83. package/.claude/skills/coding-level/references/level-0.md +131 -0
  84. package/.claude/skills/coding-level/references/level-1.md +118 -0
  85. package/.claude/skills/coding-level/references/level-2.md +140 -0
  86. package/.claude/skills/coding-level/references/level-3.md +142 -0
  87. package/.claude/skills/coding-level/references/level-4.md +152 -0
  88. package/.claude/skills/coding-level/references/level-5.md +84 -0
  89. package/.claude/skills/daily-workflow-curator/SKILL.md +52 -0
  90. package/.claude/skills/memento/SKILL.md +36 -0
  91. package/.claude/skills/reviewing-4p-priorities/SKILL.md +72 -0
  92. package/.claude/skills/reviewing-4p-priorities/examples.md +298 -0
  93. package/.claude/skills/sequential-thinking/SKILL.md +106 -0
  94. package/.claude/skills/sequential-thinking/examples/adaptive-depth.md +542 -0
  95. package/.claude/skills/sequential-thinking/examples/branching-exploration.md +474 -0
  96. package/.claude/skills/sequential-thinking/examples/linear-reasoning.md +210 -0
  97. package/.claude/skills/sequential-thinking/examples/revision-pattern.md +304 -0
  98. package/.claude/skills/sequential-thinking/references/output-schema.md +483 -0
  99. package/.claude/skills/sequential-thinking/references/parameters.md +463 -0
  100. package/.claude/skills/sequential-thinking/references/patterns.md +666 -0
  101. package/.claude/skills/vibekit-init/SKILL.md +52 -0
  102. package/.claude/skills/visual-design-loop/SKILL.md +103 -0
  103. package/.claude/skills/visual-design-loop/agents/openai.yaml +4 -0
  104. package/.codex/README.md +11 -0
  105. package/.codex/config.example.toml +8 -0
  106. package/.codex-plugin/plugin.json +10 -0
  107. package/.cursor/commands/autoresearch-coding.md +11 -0
  108. package/.cursor/commands/council.md +3 -0
  109. package/.cursor/commands/daily-enhance.md +3 -0
  110. package/.cursor/commands/init-vibe.md +3 -0
  111. package/.cursor/commands/security-scan.md +3 -0
  112. package/.cursor/commands/vibe-finalize.md +3 -0
  113. package/.cursor/rules/001-vibe-core.mdc +6 -0
  114. package/.cursor/rules/010-init.mdc +7 -0
  115. package/.cursor/rules/020-security-agentshield.mdc +7 -0
  116. package/.cursor/rules/030-autoresearch-loop.mdc +7 -0
  117. package/.cursor/settings.json +22 -0
  118. package/.cursor/skills/clearthought/SKILL.md +100 -0
  119. package/.cursor/skills/clearthought/examples/decision-framework.md +441 -0
  120. package/.cursor/skills/clearthought/examples/metagame-examples.md +536 -0
  121. package/.cursor/skills/clearthought/examples/sequential-thinking.md +380 -0
  122. package/.cursor/skills/clearthought/references/output-schemas.md +494 -0
  123. package/.cursor/skills/clearthought/references/parameter-reference.md +482 -0
  124. package/.cursor/skills/coding-level/SKILL.md +27 -0
  125. package/.cursor/skills/coding-level/references/level-0.md +131 -0
  126. package/.cursor/skills/coding-level/references/level-1.md +118 -0
  127. package/.cursor/skills/coding-level/references/level-2.md +140 -0
  128. package/.cursor/skills/coding-level/references/level-3.md +142 -0
  129. package/.cursor/skills/coding-level/references/level-4.md +152 -0
  130. package/.cursor/skills/coding-level/references/level-5.md +84 -0
  131. package/.cursor/skills/memento/SKILL.md +36 -0
  132. package/.cursor/skills/reviewing-4p-priorities/SKILL.md +72 -0
  133. package/.cursor/skills/reviewing-4p-priorities/examples.md +298 -0
  134. package/.cursor/skills/sequential-thinking/SKILL.md +106 -0
  135. package/.cursor/skills/sequential-thinking/examples/adaptive-depth.md +542 -0
  136. package/.cursor/skills/sequential-thinking/examples/branching-exploration.md +474 -0
  137. package/.cursor/skills/sequential-thinking/examples/linear-reasoning.md +210 -0
  138. package/.cursor/skills/sequential-thinking/examples/revision-pattern.md +304 -0
  139. package/.cursor/skills/sequential-thinking/references/output-schema.md +483 -0
  140. package/.cursor/skills/sequential-thinking/references/parameters.md +463 -0
  141. package/.cursor/skills/sequential-thinking/references/patterns.md +666 -0
  142. package/.vbkit-commands/autoresearch-coding.md +11 -0
  143. package/.vbkit-commands/council.md +3 -0
  144. package/.vbkit-commands/daily-enhance.md +3 -0
  145. package/.vbkit-commands/init-vibe.md +3 -0
  146. package/.vbkit-commands/security-scan.md +3 -0
  147. package/.vbkit-commands/vibe-finalize.md +3 -0
  148. package/.vbkit-docs/AUTORESEARCH_LEDGER.md +11 -0
  149. package/.vbkit-docs/BACKBONE_REFERENCE.md +59 -0
  150. package/.vbkit-docs/INSTALL.md +120 -0
  151. package/.vbkit-docs/RESEARCH_NOTES.md +22 -0
  152. package/.vbkit-docs/SECURITY_MODEL.md +40 -0
  153. package/.vbkit-docs/TOOLING_GUIDE.md +22 -0
  154. package/.vbkit-docs/backbone.schema.json +110 -0
  155. package/.vbkit-docs/templates/CONTEXT_TEMPLATE.md +47 -0
  156. package/.vbkit-docs/templates/PRD_TEMPLATE.md +48 -0
  157. package/.vbkit-scripts/agentshield-probe.mjs +22 -0
  158. package/.vbkit-scripts/daily-enhance.mjs +62 -0
  159. package/.vbkit-scripts/doctor.mjs +323 -0
  160. package/.vbkit-scripts/init-backbone.mjs +628 -0
  161. package/.vbkit-scripts/mvck.mjs +444 -0
  162. package/.vbkit-scripts/pack-dry-run.mjs +16 -0
  163. package/.vbkit-scripts/test-install.mjs +118 -0
  164. package/.vbkit-scripts/validate-kit.mjs +419 -0
  165. package/.vbkit-scripts/vibekit-finalize.mjs +185 -0
  166. package/AGENTS.md +60 -0
  167. package/CHANGELOG.md +34 -0
  168. package/CLAUDE-template.md +52 -0
  169. package/CODE_OF_CONDUCT.md +18 -0
  170. package/CONTRIBUTING.md +28 -0
  171. package/FIRST_PROMPT.md +54 -0
  172. package/FIRST_TIME_INIT.md +165 -0
  173. package/LICENSE +21 -0
  174. package/README.md +493 -0
  175. package/README.vi.md +431 -0
  176. package/SECURITY.md +28 -0
  177. package/backbone.yml +103 -0
  178. package/bin/mvck.js +2 -0
  179. package/bin/vibe-kit.js +2 -0
  180. package/install.ps1 +14 -0
  181. package/install.sh +8 -0
  182. package/package.json +92 -0
  183. package/skills/agentshield-security-review/SKILL.md +75 -0
  184. package/skills/agentshield-security-review/agents/openai.yaml +5 -0
  185. package/skills/agentshield-security-review/references/native-install.md +97 -0
  186. package/skills/agentshield-security-review/references/report-template.md +54 -0
  187. package/skills/agentshield-security-review/references/review-checklist.md +45 -0
  188. package/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +110 -0
  189. package/skills/autoresearch-coding/README.md +15 -0
  190. package/skills/autoresearch-coding/SKILL.md +101 -0
  191. package/skills/autoresearch-coding/references/experiment-contract.md +13 -0
  192. package/skills/autoresearch-coding/references/metric-extraction.md +8 -0
  193. package/skills/autoresearch-coding/references/result-ledger.md +15 -0
  194. package/skills/autoresearch-coding/scripts/log_result.py +24 -0
  195. package/skills/autoresearch-coding/scripts/run_logged.py +30 -0
  196. package/skills/clearthought/SKILL.md +100 -0
  197. package/skills/clearthought/examples/decision-framework.md +441 -0
  198. package/skills/clearthought/examples/metagame-examples.md +536 -0
  199. package/skills/clearthought/examples/sequential-thinking.md +380 -0
  200. package/skills/clearthought/references/output-schemas.md +494 -0
  201. package/skills/clearthought/references/parameter-reference.md +482 -0
  202. package/skills/coding-level/SKILL.md +27 -0
  203. package/skills/coding-level/references/level-0.md +131 -0
  204. package/skills/coding-level/references/level-1.md +118 -0
  205. package/skills/coding-level/references/level-2.md +140 -0
  206. package/skills/coding-level/references/level-3.md +142 -0
  207. package/skills/coding-level/references/level-4.md +152 -0
  208. package/skills/coding-level/references/level-5.md +84 -0
  209. package/skills/daily-workflow-curator/SKILL.md +52 -0
  210. package/skills/memento/SKILL.md +36 -0
  211. package/skills/reviewing-4p-priorities/SKILL.md +72 -0
  212. package/skills/reviewing-4p-priorities/examples.md +298 -0
  213. package/skills/sequential-thinking/SKILL.md +106 -0
  214. package/skills/sequential-thinking/examples/adaptive-depth.md +542 -0
  215. package/skills/sequential-thinking/examples/branching-exploration.md +474 -0
  216. package/skills/sequential-thinking/examples/linear-reasoning.md +210 -0
  217. package/skills/sequential-thinking/examples/revision-pattern.md +304 -0
  218. package/skills/sequential-thinking/references/output-schema.md +483 -0
  219. package/skills/sequential-thinking/references/parameters.md +463 -0
  220. package/skills/sequential-thinking/references/patterns.md +666 -0
  221. package/skills/vibekit-init/SKILL.md +52 -0
  222. package/skills/visual-design-loop/SKILL.md +103 -0
  223. package/skills/visual-design-loop/agents/openai.yaml +4 -0
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env python3
2
+ """Inventory AgentShield-relevant AI coding-agent surfaces in a repository.
3
+
4
+ This script is intentionally read-only. It does not execute hooks, package scripts,
5
+ MCP servers, or installer commands.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import argparse
10
+ import json
11
+ from pathlib import Path
12
+ from typing import Iterable
13
+
14
+ PATTERNS = {
15
+ "repo_instructions": ["CLAUDE.md", "AGENTS.md", ".github/copilot-instructions.md"],
16
+ "claude": [".claude", ".claude-plugin", "agents"],
17
+ "codex": [".codex", ".codex-plugin"],
18
+ "shared_skills": ["skills", ".agents/skills"],
19
+ "shared_commands": [".vbkit-commands"],
20
+ "kit_scripts": [".vbkit-scripts"],
21
+ "hooks": ["hooks", ".claude/hooks", ".agents/hooks"],
22
+ "mcp": [".mcp.json", "mcp.json", "mcp-configs"],
23
+ "ci": [".github/workflows"],
24
+ }
25
+
26
+ SUSPICIOUS_TEXT = [
27
+ "Bash" + "(*)",
28
+ "npx" + " -y",
29
+ "curl" + " | sh",
30
+ "wget" + " | sh",
31
+ "||" + " true",
32
+ "2>" + "/dev/null",
33
+ "ignore previous" + " instructions",
34
+ "ignore all previous" + " instructions",
35
+ "ANTHROPIC" + "_API_KEY=",
36
+ "OPENAI" + "_API_KEY=",
37
+ "GITHUB" + "_TOKEN=",
38
+ ]
39
+
40
+
41
+ def iter_files(path: Path) -> Iterable[Path]:
42
+ if path.is_file():
43
+ yield path
44
+ elif path.is_dir():
45
+ for child in path.rglob("*"):
46
+ if child.is_file() and ".git" not in child.parts:
47
+ yield child
48
+
49
+
50
+ def safe_read(path: Path, limit: int = 200_000) -> str:
51
+ try:
52
+ data = path.read_bytes()[:limit]
53
+ return data.decode("utf-8", errors="ignore")
54
+ except OSError:
55
+ return ""
56
+
57
+
58
+ def main() -> int:
59
+ parser = argparse.ArgumentParser(description="Inventory Claude/Codex AgentShield surfaces")
60
+ parser.add_argument("path", nargs="?", default=".", help="Repository root")
61
+ parser.add_argument("--json", action="store_true", help="Emit JSON")
62
+ args = parser.parse_args()
63
+
64
+ root = Path(args.path).resolve()
65
+ result: dict[str, object] = {"repo_root": str(root), "surfaces": {}, "suspicious_markers": []}
66
+
67
+ surfaces: dict[str, list[str]] = {}
68
+ suspicious: list[dict[str, str]] = []
69
+
70
+ for category, patterns in PATTERNS.items():
71
+ found: list[str] = []
72
+ for pattern in patterns:
73
+ candidate = root / pattern
74
+ if candidate.exists():
75
+ found.append(str(candidate.relative_to(root)))
76
+ for file_path in iter_files(candidate):
77
+ if file_path.suffix.lower() not in {".md", ".json", ".toml", ".yaml", ".yml", ".sh", ".js", ".ts"}:
78
+ continue
79
+ text = safe_read(file_path)
80
+ for marker in SUSPICIOUS_TEXT:
81
+ if marker in text:
82
+ suspicious.append({
83
+ "path": str(file_path.relative_to(root)),
84
+ "marker": marker,
85
+ "category": category,
86
+ })
87
+ surfaces[category] = found
88
+
89
+ result["surfaces"] = surfaces
90
+ result["suspicious_markers"] = suspicious
91
+
92
+ if args.json:
93
+ print(json.dumps(result, indent=2, sort_keys=True))
94
+ else:
95
+ print(f"Repo root: {root}")
96
+ print("\nActive-looking surfaces:")
97
+ for category, paths in surfaces.items():
98
+ if paths:
99
+ print(f"- {category}: {', '.join(paths)}")
100
+ if suspicious:
101
+ print("\nSuspicious markers needing review:")
102
+ for item in suspicious:
103
+ print(f"- {item['path']} [{item['category']}]: {item['marker']}")
104
+ else:
105
+ print("\nNo built-in suspicious markers found by probe. Run AgentShield for full analysis.")
106
+ return 0
107
+
108
+
109
+ if __name__ == "__main__":
110
+ raise SystemExit(main())
@@ -0,0 +1,15 @@
1
+ # Autoresearch Coding
2
+
3
+ Metric-driven improvement loop for AI coding agents.
4
+
5
+ Example:
6
+
7
+ ```text
8
+ /autoresearch-coding goal: improve API latency; metric command: npm run bench; direction: lower; editable paths: src/api src/lib; protected paths: .env* migrations; budget: 5
9
+ ```
10
+
11
+ For this kit:
12
+
13
+ ```text
14
+ /autoresearch-coding goal: improve the kit; metric command: node .vbkit-scripts/validate-kit.mjs .; direction: higher; editable paths: .vbkit-docs .vbkit-scripts skills .vbkit-commands .claude .cursor .agents .codex-plugin; budget: 3
15
+ ```
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: autoresearch-coding
3
+ description: Run a metric-driven coding experiment loop. Use when improving a repo through repeated hypotheses, benchmark-guided changes, validation, keep/discard decisions, or safe workflow enhancement. Requires a goal, metric command, direction, editable paths, protected paths, and budget.
4
+ disable-model-invocation: true
5
+ argument-hint: goal; metric command; direction; editable paths; protected paths; budget; timeout
6
+ ---
7
+
8
+ # Autoresearch Coding Loop
9
+
10
+ Run a controlled experiment loop. Do not perform open-ended destructive work.
11
+
12
+ ## Contract
13
+
14
+ Extract or infer:
15
+
16
+ - Goal.
17
+ - Metric command.
18
+ - Direction: `lower` or `higher` is better.
19
+ - Editable paths.
20
+ - Protected paths.
21
+ - Budget, default 3.
22
+ - Timeout, default 10 minutes.
23
+
24
+ If the metric command or editable scope is missing, infer conservative defaults and show the contract before editing. If no safe metric exists, ask for one.
25
+ Always print the resolved contract before the baseline run, and label inferred fields.
26
+
27
+ For this kit itself, use:
28
+
29
+ ```text
30
+ goal: improve Minimal Vibe Coding Kit quality
31
+ metric command: node .vbkit-scripts/validate-kit.mjs .
32
+ direction: higher
33
+ editable paths: .vbkit-docs .vbkit-scripts skills .vbkit-commands .claude .cursor .agents .codex-plugin .github README.md AGENTS.md CLAUDE-template.md FIRST_TIME_INIT.md FIRST_PROMPT.md backbone.yml package.json install.sh install.ps1
34
+ protected paths: .git .env* node_modules vendor secrets lockfiles
35
+ budget: 3
36
+ ```
37
+
38
+ ## Setup
39
+
40
+ 1. Read `backbone.yml`. If `meta.template_status` is `uninitialized`, follow `FIRST_TIME_INIT.md` and wait for explicit approval before experiment edits.
41
+ 2. Inspect `git status --short`.
42
+ 3. If user changes exist, stop unless the user permits dirty-state experimentation.
43
+ 4. Create or switch to an experiment branch named `autoresearch/<date>-<slug>` when a git repo is available. If branch creation is blocked by permissions, ask for approval once and record any approved fallback.
44
+ 5. Create local-only paths if missing:
45
+ - `.autoresearch/logs/`
46
+ - `.autoresearch/notes/`
47
+ - `results.tsv`
48
+ 6. Initialize `results.tsv` with:
49
+
50
+ ```text
51
+ commit metric_value direction status seconds log_path description
52
+ ```
53
+
54
+ Do not commit `.autoresearch/` or `results.tsv` unless the user asks.
55
+
56
+ ## Baseline
57
+
58
+ Before edits:
59
+
60
+ 1. Run the metric command once.
61
+ 2. Save output to `.autoresearch/logs/baseline.log`.
62
+ 3. Extract a metric value using `references/metric-extraction.md`. If ambiguous, use pass/fail plus warning count and explain.
63
+ 4. Append a baseline row with status `keep`.
64
+
65
+ ## Experiment loop
66
+
67
+ For each experiment:
68
+
69
+ 1. Read the best kept result from `results.tsv`.
70
+ 2. Form one small hypothesis.
71
+ 3. Modify only editable paths.
72
+ 4. Run the metric command with timeout and log output.
73
+ 5. Decide:
74
+ - `keep`: metric improves, or equal metric with simpler safer code.
75
+ - `discard`: worse or equal without simplification.
76
+ - `crash`: command fails, times out, or no usable metric.
77
+ 6. Append a row to `results.tsv`.
78
+ 7. Keep good changes; revert discarded or crashed changes.
79
+ 8. If a crash is from a trivial patch mistake, fix once and rerun.
80
+
81
+ If a kept change touches agent surfaces such as `AGENTS.md`, `CLAUDE.md`, `.claude/**`, `.cursor/**`, `.agents/**`, `.codex-plugin/**`, `skills/**`, `.vbkit-commands/**`, `.vbkit-scripts/**`, hooks, or MCP config, run the AgentShield probe before final reporting.
82
+
83
+ ## Delegation
84
+
85
+ Use subagents when available:
86
+
87
+ - `hypothesis-planner`: next experiment idea.
88
+ - `implementation-hacker`: apply scoped patch.
89
+ - `test-runner`: run noisy commands and return metrics.
90
+ - `debug-fixer`: fix trivial crash bugs.
91
+ - `code-reviewer`: review kept changes.
92
+ - `results-analyst`: summarize ledger.
93
+ - `security-reviewer`: review agent-surface changes.
94
+
95
+ ## Stop
96
+
97
+ Stop when budget is reached, metric is missing, protected paths are needed, three unrelated crashes happen, or the user changes the goal.
98
+
99
+ ## Final report
100
+
101
+ Report baseline, best metric, kept/discarded/crashed counts, changed files, validation output, security probe result when relevant, risks, and log locations.
@@ -0,0 +1,13 @@
1
+ # Experiment contract
2
+
3
+ Required fields:
4
+
5
+ - Goal
6
+ - Metric command
7
+ - Direction: lower or higher
8
+ - Editable paths
9
+ - Protected paths
10
+ - Budget
11
+ - Timeout
12
+
13
+ The agent must print the contract before editing. If any field is inferred, label it `inferred`.
@@ -0,0 +1,8 @@
1
+ # Metric extraction
2
+
3
+ Prefer a numeric metric from the command output. If the command only returns pass/fail, score it as:
4
+
5
+ - pass: 1
6
+ - fail: 0
7
+
8
+ When warnings matter, report pass/fail plus warning count. Do not hide failures behind a single score.
@@ -0,0 +1,15 @@
1
+ # Result ledger
2
+
3
+ Use `results.tsv` with this header:
4
+
5
+ ```text
6
+ commit metric_value direction status seconds log_path description
7
+ ```
8
+
9
+ Status values:
10
+
11
+ - `keep`
12
+ - `discard`
13
+ - `crash`
14
+
15
+ Keep verbose command output in `.autoresearch/logs/`.
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+ from pathlib import Path
4
+
5
+ HEADER = "commit\tmetric_value\tdirection\tstatus\tseconds\tlog_path\tdescription\n"
6
+
7
+ parser = argparse.ArgumentParser(description="Append an autoresearch result row")
8
+ parser.add_argument("--file", default="results.tsv")
9
+ parser.add_argument("--commit", required=True)
10
+ parser.add_argument("--metric", required=True)
11
+ parser.add_argument("--direction", required=True, choices=["lower", "higher"])
12
+ parser.add_argument("--status", required=True, choices=["keep", "discard", "crash"])
13
+ parser.add_argument("--seconds", required=True)
14
+ parser.add_argument("--log", required=True)
15
+ parser.add_argument("--description", required=True)
16
+ args = parser.parse_args()
17
+
18
+ path = Path(args.file)
19
+ if not path.exists():
20
+ path.write_text(HEADER, encoding="utf-8")
21
+ row = "\t".join([args.commit, args.metric, args.direction, args.status, args.seconds, args.log, args.description.replace("\t", " ")]) + "\n"
22
+ with path.open("a", encoding="utf-8") as f:
23
+ f.write(row)
24
+ print(f"logged {args.status} -> {path}")
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+ import subprocess
4
+ import time
5
+ from pathlib import Path
6
+
7
+ parser = argparse.ArgumentParser(description="Run a command with timeout and log output")
8
+ parser.add_argument("command", help="Shell command to run")
9
+ parser.add_argument("--log", required=True, help="Log path")
10
+ parser.add_argument("--timeout", type=int, default=600)
11
+ args = parser.parse_args()
12
+
13
+ log = Path(args.log)
14
+ log.parent.mkdir(parents=True, exist_ok=True)
15
+ start = time.time()
16
+ try:
17
+ result = subprocess.run(args.command, shell=True, text=True, capture_output=True, timeout=args.timeout)
18
+ seconds = time.time() - start
19
+ log.write_text(result.stdout + result.stderr, encoding="utf-8", errors="ignore")
20
+ print(f"exit_code={result.returncode}")
21
+ print(f"seconds={seconds:.3f}")
22
+ print(f"log={log}")
23
+ raise SystemExit(result.returncode)
24
+ except subprocess.TimeoutExpired as exc:
25
+ seconds = time.time() - start
26
+ log.write_text((exc.stdout or "") + (exc.stderr or "") + f"\nTIMEOUT after {args.timeout}s\n", encoding="utf-8", errors="ignore")
27
+ print("exit_code=124")
28
+ print(f"seconds={seconds:.3f}")
29
+ print(f"log={log}")
30
+ raise SystemExit(124)
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: clearthought
3
+ description: Structured reasoning for complex coding work. Use when requirements are ambiguous, a design/debugging decision has multiple valid paths, or a large request needs to be split into safe implementable tasks.
4
+ argument-hint: "[operation] <problem>"
5
+ user-invocable: true
6
+ effort: high
7
+ ---
8
+
9
+ # ClearThought
10
+
11
+ Use ClearThought to turn complex or ambiguous coding work into an evidence-based implementation plan.
12
+
13
+ ## Best Use
14
+
15
+ Use this skill when:
16
+
17
+ - requirements are broad, conflicting, or under-specified;
18
+ - a bug needs root-cause analysis before editing;
19
+ - an architecture or refactor decision has tradeoffs;
20
+ - a task needs to be split into small pull-request sized steps;
21
+ - the user asks for deliberate reasoning, ClearThought, or a structured decision.
22
+
23
+ ## Operations
24
+
25
+ Choose the narrowest operation that fits:
26
+
27
+ - `sequential_thinking`: decompose a complex request into ordered work.
28
+ - `debugging_approach`: isolate a broken behavior with hypotheses and checks.
29
+ - `decision_framework`: compare implementation options and choose one.
30
+ - `systems_thinking`: map components, contracts, and side effects.
31
+ - `scientific_method`: define hypothesis, metric, baseline, experiment, and result.
32
+ - `risk_review`: identify safety, security, data, and rollback risks.
33
+ - `implementation_plan`: produce an edit plan, validation plan, and review checklist.
34
+
35
+ If the operation is omitted, infer it from the request. Default to `sequential_thinking`.
36
+
37
+ ## Workflow
38
+
39
+ 1. Read `AGENTS.md` and `backbone.yml` before repo edits.
40
+ 2. Separate observed facts, assumptions, unknowns, and decisions.
41
+ 3. Pick one operation and keep the reasoning focused on the next useful action.
42
+ 4. Split the work into safe tasks with file or module ownership where possible.
43
+ 5. Define validation commands and risk checks before editing.
44
+ 6. Revisit the plan when new evidence invalidates an assumption.
45
+
46
+ ## Output
47
+
48
+ For normal coding work, return this concise structure:
49
+
50
+ ```markdown
51
+ ## ClearThought Brief
52
+
53
+ Operation: <operation>
54
+ Problem: <one sentence>
55
+ Observed facts:
56
+ - <facts from files, tests, logs, or user request>
57
+ Assumptions:
58
+ - <explicit assumptions>
59
+ Plan:
60
+ 1. <small implementable step>
61
+ 2. <small implementable step>
62
+ Validation:
63
+ - <commands or checks>
64
+ Risks:
65
+ - <risk and mitigation>
66
+ ```
67
+
68
+ For user-invoked JSON mode, return valid JSON:
69
+
70
+ ```json
71
+ {
72
+ "toolOperation": "operation_name",
73
+ "problem": "brief problem statement",
74
+ "observedFacts": [],
75
+ "assumptions": [],
76
+ "plan": [],
77
+ "validation": [],
78
+ "risks": [],
79
+ "sessionContext": {
80
+ "sessionId": "conversation"
81
+ }
82
+ }
83
+ ```
84
+
85
+ ## References And Examples
86
+
87
+ Load these only when the active task needs more detail:
88
+
89
+ - `references/parameter-reference.md`: operation parameters and accepted values.
90
+ - `references/output-schemas.md`: JSON response shapes for supported operations.
91
+ - `examples/sequential-thinking.md`: decomposition and step-by-step planning examples.
92
+ - `examples/decision-framework.md`: option comparison and tradeoff examples.
93
+ - `examples/metagame-examples.md`: OODA, Ulysses, and high-stakes reasoning examples.
94
+
95
+ ## Safety
96
+
97
+ - Do not expose long hidden reasoning. Provide concise rationale and actionable conclusions.
98
+ - Do not invent facts. Mark weak evidence as an assumption or unknown.
99
+ - Do not run package lifecycle scripts, hooks, deploys, migrations, or destructive commands just to think.
100
+ - Prefer reversible changes and small diffs when uncertainty is high.