minimal-vibe-coding-kit 0.4.1 → 0.4.2

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 (84) hide show
  1. package/.agents/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +28 -3
  2. package/.agents/skills/prompt-sharpener/SKILL.md +54 -0
  3. package/.agents/skills/vibekit-init/SKILL.md +2 -2
  4. package/.claude/settings.json +10 -3
  5. package/.claude/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +28 -3
  6. package/.claude/skills/prompt-sharpener/SKILL.md +54 -0
  7. package/.claude/skills/vibekit-init/SKILL.md +2 -2
  8. package/.codex/rules/vibekit.rules +77 -0
  9. package/.codex-plugin/plugin.json +1 -1
  10. package/.cursor/cli.json +18 -0
  11. package/.cursor/settings.json +15 -8
  12. package/.cursor/skills/prompt-sharpener/SKILL.md +54 -0
  13. package/.grok/README.md +13 -0
  14. package/.grok/config.example.toml +13 -0
  15. package/.grok/config.toml +29 -0
  16. package/.grok/rules/safe-delete.md +11 -0
  17. package/.grok/rules/security.md +5 -0
  18. package/.grok/rules/vibe-core.md +8 -0
  19. package/.grok/skills/agentshield-security-review/SKILL.md +75 -0
  20. package/.grok/skills/agentshield-security-review/agents/openai.yaml +5 -0
  21. package/.grok/skills/agentshield-security-review/references/native-install.md +97 -0
  22. package/.grok/skills/agentshield-security-review/references/report-template.md +54 -0
  23. package/.grok/skills/agentshield-security-review/references/review-checklist.md +45 -0
  24. package/.grok/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +135 -0
  25. package/.grok/skills/autoresearch-coding/README.md +15 -0
  26. package/.grok/skills/autoresearch-coding/SKILL.md +101 -0
  27. package/.grok/skills/autoresearch-coding/references/experiment-contract.md +13 -0
  28. package/.grok/skills/autoresearch-coding/references/metric-extraction.md +8 -0
  29. package/.grok/skills/autoresearch-coding/references/result-ledger.md +15 -0
  30. package/.grok/skills/autoresearch-coding/scripts/log_result.py +24 -0
  31. package/.grok/skills/autoresearch-coding/scripts/run_logged.py +30 -0
  32. package/.grok/skills/clearthought/SKILL.md +100 -0
  33. package/.grok/skills/clearthought/examples/decision-framework.md +441 -0
  34. package/.grok/skills/clearthought/examples/metagame-examples.md +536 -0
  35. package/.grok/skills/clearthought/examples/sequential-thinking.md +380 -0
  36. package/.grok/skills/clearthought/references/output-schemas.md +494 -0
  37. package/.grok/skills/clearthought/references/parameter-reference.md +482 -0
  38. package/.grok/skills/coding-level/SKILL.md +34 -0
  39. package/.grok/skills/coding-level/references/level-0.md +131 -0
  40. package/.grok/skills/coding-level/references/level-1.md +118 -0
  41. package/.grok/skills/coding-level/references/level-2.md +140 -0
  42. package/.grok/skills/coding-level/references/level-3.md +142 -0
  43. package/.grok/skills/coding-level/references/level-4.md +152 -0
  44. package/.grok/skills/coding-level/references/level-5.md +84 -0
  45. package/.grok/skills/daily-workflow-curator/SKILL.md +52 -0
  46. package/.grok/skills/memento/SKILL.md +36 -0
  47. package/.grok/skills/parallel-analysis/SKILL.md +160 -0
  48. package/.grok/skills/path-sensitive-shell-safety/SKILL.md +69 -0
  49. package/.grok/skills/path-sensitive-shell-safety/references/workflow.md +127 -0
  50. package/.grok/skills/prompt-sharpener/SKILL.md +54 -0
  51. package/.grok/skills/reviewing-4p-priorities/SKILL.md +72 -0
  52. package/.grok/skills/reviewing-4p-priorities/examples.md +298 -0
  53. package/.grok/skills/sequential-thinking/SKILL.md +106 -0
  54. package/.grok/skills/sequential-thinking/examples/adaptive-depth.md +542 -0
  55. package/.grok/skills/sequential-thinking/examples/branching-exploration.md +474 -0
  56. package/.grok/skills/sequential-thinking/examples/linear-reasoning.md +210 -0
  57. package/.grok/skills/sequential-thinking/examples/revision-pattern.md +304 -0
  58. package/.grok/skills/sequential-thinking/references/output-schema.md +483 -0
  59. package/.grok/skills/sequential-thinking/references/parameters.md +463 -0
  60. package/.grok/skills/sequential-thinking/references/patterns.md +666 -0
  61. package/.grok/skills/vibekit-init/SKILL.md +52 -0
  62. package/.grok/skills/visual-design-loop/SKILL.md +103 -0
  63. package/.grok/skills/visual-design-loop/agents/openai.yaml +4 -0
  64. package/.vibekit/docs/BACKBONE_REFERENCE.md +1 -1
  65. package/.vibekit/docs/INSTALL.md +9 -7
  66. package/.vibekit/docs/SECURITY_MODEL.md +1 -1
  67. package/.vibekit/docs/TOOLING_GUIDE.md +5 -0
  68. package/.vibekit/docs/templates/CONTEXT_TEMPLATE.md +1 -1
  69. package/.vibekit/init/CLAUDE-template.md +1 -0
  70. package/.vibekit/init/FIRST_PROMPT.md +1 -1
  71. package/.vibekit/init/FIRST_TIME_INIT.md +2 -2
  72. package/.vibekit/scripts/doctor.mjs +11 -4
  73. package/.vibekit/scripts/mvck.mjs +24 -9
  74. package/.vibekit/scripts/test-install.mjs +8 -0
  75. package/.vibekit/scripts/validate-kit.mjs +104 -39
  76. package/.vibekit/skills/agentshield-security-review/scripts/agentshield_repo_probe.py +28 -3
  77. package/.vibekit/skills/prompt-sharpener/SKILL.md +54 -0
  78. package/.vibekit/skills/vibekit-init/SKILL.md +2 -2
  79. package/AGENTS.md +2 -2
  80. package/CHANGELOG.md +10 -0
  81. package/README.md +17 -12
  82. package/backbone.yml +2 -1
  83. package/docs/README.vi.md +56 -51
  84. package/package.json +7 -2
@@ -0,0 +1,97 @@
1
+ # Native Claude Code and Codex Install Pattern
2
+
3
+ Keep one canonical skill and add thin harness adapters.
4
+
5
+ ## Shared skill location
6
+
7
+ Recommended repo layout:
8
+
9
+ ```text
10
+ .vibekit/skills/agentshield-security-review/SKILL.md
11
+ .vibekit/skills/agentshield-security-review/references/review-checklist.md
12
+ .vibekit/skills/agentshield-security-review/references/report-template.md
13
+ .vibekit/skills/agentshield-security-review/scripts/agentshield_repo_probe.py
14
+ .vibekit/commands/security-scan.md
15
+ .codex-plugin/plugin.json
16
+ .claude-plugin/plugin.json
17
+ ```
18
+
19
+ ## Claude Code command shim
20
+
21
+ Create `.vibekit/commands/security-scan.md` or `.claude/commands/security-scan.md`:
22
+
23
+ ```markdown
24
+ ---
25
+ description: Run an AgentShield-style security scan against agent, hook, MCP, permission, skill, command, Claude, and Codex surfaces.
26
+ agent: security-reviewer
27
+ subtask: true
28
+ ---
29
+
30
+ # Security Scan
31
+
32
+ Run the shared `agentshield-security-review` skill against the current repo or the target path.
33
+
34
+ ## Usage
35
+
36
+ `/security-scan [path] [--format text|json|markdown|html] [--min-severity low|medium|high|critical] [--fix]`
37
+
38
+ Prefer the deterministic scanner:
39
+
40
+ ```bash
41
+ npx ecc-agentshield scan --path "${TARGET_PATH:-.}" --format text
42
+ ```
43
+
44
+ If `--fix` is requested, summarize planned safe fixes first, apply only scanner-marked safe fixes, then re-run the scan.
45
+
46
+ Return grade, score, severity counts, active paths, critical/high findings, and remediation order.
47
+ ```
48
+
49
+ ## Codex plugin pointer
50
+
51
+ Use the repo-level Codex plugin manifest to point Codex at the same `.vibekit/skills/` directory. Exact schema may vary by Codex plugin version, so preserve the existing repo schema and ensure it references the canonical `.vibekit/skills/` directory rather than a copied skill body.
52
+
53
+ Example intent:
54
+
55
+ ```json
56
+ {
57
+ "name": "your-repo",
58
+ "version": "0.1.0",
59
+ "skills": "./.vibekit/skills",
60
+ "mcp": "./.mcp.json"
61
+ }
62
+ ```
63
+
64
+ ## CI gate
65
+
66
+ Add a GitHub Actions job when you want agent config changes to fail builds:
67
+
68
+ ```yaml
69
+ name: agent-security
70
+ on:
71
+ pull_request:
72
+ paths:
73
+ - "CLAUDE.md"
74
+ - "AGENTS.md"
75
+ - ".claude/**"
76
+ - ".codex/**"
77
+ - ".codex-plugin/**"
78
+ - ".claude-plugin/**"
79
+ - ".agents/**"
80
+ - "agents/**"
81
+ - ".vibekit/skills/**"
82
+ - ".vibekit/commands/**"
83
+ - "hooks/**"
84
+ - ".mcp.json"
85
+ - "mcp-configs/**"
86
+
87
+ jobs:
88
+ agentshield:
89
+ runs-on: ubuntu-latest
90
+ steps:
91
+ - uses: actions/checkout@v4
92
+ - uses: actions/setup-node@v4
93
+ with:
94
+ node-version: "20"
95
+ - name: Run AgentShield
96
+ run: npx ecc-agentshield scan --path . --format text --min-severity medium
97
+ ```
@@ -0,0 +1,54 @@
1
+ # Security Review Report Template
2
+
3
+ Use this structure for final reports.
4
+
5
+ ## Summary
6
+
7
+ - Scan mode:
8
+ - Grade/score:
9
+ - Repo root:
10
+ - Harnesses found:
11
+ - Overall risk:
12
+
13
+ ## Commands run
14
+
15
+ ```bash
16
+ # commands here
17
+ ```
18
+
19
+ ## Active surfaces found
20
+
21
+ | Surface | Paths | Runtime confidence |
22
+ |---|---|---|
23
+ | Claude | | |
24
+ | Codex | | |
25
+ | Shared skills | | |
26
+ | Hooks | | |
27
+ | MCP | | |
28
+ | CI/plugin | | |
29
+
30
+ ## Critical/high findings
31
+
32
+ | Severity | Confidence | Path | Issue | Why it matters | Fix | Auto-fix safe? |
33
+ |---|---|---|---|---|---|---|
34
+
35
+ ## Medium/low findings
36
+
37
+ Group by theme: permissions, hooks, MCP, prompts, skills, .vibekit/docs/examples.
38
+
39
+ ## Remediation order
40
+
41
+ 1. Remove or rotate exposed secrets.
42
+ 2. Restrict shell/tool permissions.
43
+ 3. Pin or sandbox MCP/package execution.
44
+ 4. Harden hooks and quote/sanitize variables.
45
+ 5. Add CI gate.
46
+ 6. Remove duplicate divergent Claude/Codex skill copies.
47
+ 7. Re-run scan and confirm grade improvement.
48
+
49
+ ## Native integration status
50
+
51
+ - Claude Code:
52
+ - Codex:
53
+ - Shared skill source:
54
+ - Drift risks:
@@ -0,0 +1,45 @@
1
+ # AgentShield Manual Review Checklist
2
+
3
+ Use this checklist when `ecc-agentshield` is unavailable or when reviewing scanner output.
4
+
5
+ ## Critical findings
6
+
7
+ Flag as critical when a runtime-active agent surface contains any of these:
8
+
9
+ - Hardcoded API keys, tokens, private keys, passwords, or webhook secrets.
10
+ - Unrestricted shell permissions such as `Bash` wildcard permissions, `bash -c` passthroughs, or unrestricted command execution in hooks.
11
+ - Hook command injection risk from unsanitized variables such as file paths, branch names, issue titles, PR text, or model-provided arguments.
12
+ - MCP server definitions that execute shell commands, pull remote code dynamically, or expose broad filesystem/network access without pinning or sandboxing.
13
+ - Instructions that tell the agent to ignore system/developer safety boundaries or auto-run commands from untrusted content.
14
+
15
+ ## High findings
16
+
17
+ Flag as high when active config contains:
18
+
19
+ - Missing deny lists for destructive commands.
20
+ - Broad tool permissions for agents that only need read/review access.
21
+ - `npx` auto-yes flags, curl-piped-to-shell, or remote install during runtime without pinning/checksum.
22
+ - Agents that ingest untrusted web/issues/PRs without prompt-injection boundaries.
23
+ - Hooks that send repository content to remote endpoints without explicit disclosure.
24
+
25
+ ## Medium findings
26
+
27
+ Flag as medium when active config contains:
28
+
29
+ - Silent failure suppression such as always-success shell fallbacks, stderr suppression, or broad `try/catch` around security checks.
30
+ - Missing descriptions for MCP servers or agent purposes.
31
+ - Duplicate Claude/Codex skill copies likely to drift.
32
+ - Lack of CI security scan for agent config changes.
33
+
34
+ ## Low/info findings
35
+
36
+ Flag as low/info for documentation gaps, inactive examples, or optional templates that do not affect runtime.
37
+
38
+ ## Review confidence
39
+
40
+ Use these labels:
41
+
42
+ - `active-runtime`: loaded by current harness or plugin manifest.
43
+ - `repo-template`: checked-in template that users may copy.
44
+ - `documentation-example`: not active unless copied.
45
+ - `unknown`: unable to determine loading path.
@@ -0,0 +1,135 @@
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
+ "grok": [".grok"],
19
+ "shared_skills": [".vibekit/skills", ".claude/skills", ".cursor/skills", ".agents/skills", ".grok/skills", "skills"],
20
+ "shared_commands": [".vibekit/commands"],
21
+ "kit_scripts": [".vibekit/scripts"],
22
+ "hooks": ["hooks", ".claude/hooks", ".agents/hooks", ".grok/hooks"],
23
+ "mcp": [".mcp.json", "mcp.json", "mcp-configs"],
24
+ "ci": [".github/workflows"],
25
+ }
26
+
27
+ SUSPICIOUS_TEXT = [
28
+ "Bash" + "(*)",
29
+ "npx" + " -y",
30
+ "curl" + " | sh",
31
+ "wget" + " | sh",
32
+ "||" + " true",
33
+ "2>" + "/dev/null",
34
+ "ignore previous" + " instructions",
35
+ "ignore all previous" + " instructions",
36
+ "ANTHROPIC" + "_API_KEY=",
37
+ "OPENAI" + "_API_KEY=",
38
+ "GITHUB" + "_TOKEN=",
39
+ ]
40
+
41
+
42
+ def iter_files(path: Path) -> Iterable[Path]:
43
+ if path.is_file():
44
+ yield path
45
+ elif path.is_dir():
46
+ for child in path.rglob("*"):
47
+ if child.is_file() and ".git" not in child.parts:
48
+ yield child
49
+
50
+
51
+ def safe_read(path: Path, limit: int = 200_000) -> str:
52
+ try:
53
+ data = path.read_bytes()[:limit]
54
+ return data.decode("utf-8", errors="ignore")
55
+ except OSError:
56
+ return ""
57
+
58
+
59
+ def deny_block_lines(text: str) -> set[int]:
60
+ """Line indexes inside a permissions deny array (JSON `"deny": [` or TOML `deny = [`).
61
+
62
+ Deny rules quote dangerous patterns in order to block them, so a marker on
63
+ those lines is defensive, not suspicious. Allow/ask blocks are still scanned.
64
+ """
65
+ covered: set[int] = set()
66
+ inside = False
67
+ for idx, line in enumerate(text.splitlines()):
68
+ stripped = line.strip()
69
+ if not inside and "[" in stripped and ('"deny"' in stripped or stripped.startswith("deny =") or stripped.startswith("deny=")):
70
+ covered.add(idx)
71
+ inside = "]" not in stripped.split("[", 1)[1]
72
+ continue
73
+ if inside:
74
+ covered.add(idx)
75
+ if "]" in stripped:
76
+ inside = False
77
+ return covered
78
+
79
+
80
+ def main() -> int:
81
+ parser = argparse.ArgumentParser(description="Inventory Claude/Codex AgentShield surfaces")
82
+ parser.add_argument("path", nargs="?", default=".", help="Repository root")
83
+ parser.add_argument("--json", action="store_true", help="Emit JSON")
84
+ args = parser.parse_args()
85
+
86
+ root = Path(args.path).resolve()
87
+ result: dict[str, object] = {"repo_root": str(root), "surfaces": {}, "suspicious_markers": []}
88
+
89
+ surfaces: dict[str, list[str]] = {}
90
+ suspicious: list[dict[str, str]] = []
91
+
92
+ for category, patterns in PATTERNS.items():
93
+ found: list[str] = []
94
+ for pattern in patterns:
95
+ candidate = root / pattern
96
+ if candidate.exists():
97
+ found.append(str(candidate.relative_to(root)))
98
+ for file_path in iter_files(candidate):
99
+ if file_path.suffix.lower() not in {".md", ".json", ".toml", ".yaml", ".yml", ".sh", ".js", ".ts"}:
100
+ continue
101
+ text = safe_read(file_path)
102
+ skip_lines = deny_block_lines(text)
103
+ lines = text.splitlines()
104
+ for marker in SUSPICIOUS_TEXT:
105
+ hits = [idx for idx, line in enumerate(lines) if marker in line]
106
+ if any(idx not in skip_lines for idx in hits):
107
+ suspicious.append({
108
+ "path": str(file_path.relative_to(root)),
109
+ "marker": marker,
110
+ "category": category,
111
+ })
112
+ surfaces[category] = found
113
+
114
+ result["surfaces"] = surfaces
115
+ result["suspicious_markers"] = suspicious
116
+
117
+ if args.json:
118
+ print(json.dumps(result, indent=2, sort_keys=True))
119
+ else:
120
+ print(f"Repo root: {root}")
121
+ print("\nActive-looking surfaces:")
122
+ for category, paths in surfaces.items():
123
+ if paths:
124
+ print(f"- {category}: {', '.join(paths)}")
125
+ if suspicious:
126
+ print("\nSuspicious markers needing review:")
127
+ for item in suspicious:
128
+ print(f"- {item['path']} [{item['category']}]: {item['marker']}")
129
+ else:
130
+ print("\nNo built-in suspicious markers found by probe. Run AgentShield for full analysis.")
131
+ return 0
132
+
133
+
134
+ if __name__ == "__main__":
135
+ 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 .vibekit/scripts/validate-kit.mjs .; direction: higher; editable paths: .vibekit/docs .vibekit/scripts .vibekit/skills .vibekit/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 .vibekit/scripts/validate-kit.mjs .
32
+ direction: higher
33
+ editable paths: .vibekit/docs .vibekit/scripts .vibekit/skills .vibekit/commands .claude .cursor .agents .codex-plugin .github README.md AGENTS.md .vibekit/init/CLAUDE-template.md .vibekit/init/FIRST_TIME_INIT.md .vibekit/init/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 `.vibekit/init/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/**`, `.vibekit/skills/**`, `.vibekit/commands/**`, `.vibekit/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.