Use when a repeatable task must become a bounded Trigger -> Execute -> Verify -> State loop, scheduled automation, goal agent, or metric-driven research cycle.
npx skills add https://github.com/Mark393295827/third-brain-v7-skills --skill loop-engineering
<skill_contract>
<input>A repeatable task with inspectable state, finite budgets, permissions, and an independent verifier.</input>
<output>A validated Trigger -> Execute -> Verify -> State contract plus resumable run receipts.</output>
<done>The declared metric or stop condition is supported by fresh validator and verifier evidence.</done>
<non_goals>Dependency-graph orchestration, unbounded autonomy, or self-certified completion.</non_goals>
Build loops only when repeated execution creates evidence. Every loop needs admission, a validated contract, durable state, independent evaluation, bounded retries, stop/recovery rules, and a final receipt.
Provide: objective, trigger, scope/non-goals, inputs, state/artifact paths, metric, verifier, permissions, budgets, stop condition, recovery, and write-back. See references/ci-repair-loop-example.md for a worked contract.
<intake>
Select one mode:
Admit only if work is repeatable, outputs are inspectable, a verifier exists, failures are recoverable, and autonomy is worth the orchestration/review cost. Otherwise use a one-shot workflow.
Use graph-engineering instead when explicit data dependencies, independent
branches, typed joins, or node-local recovery create measurable value. A Graph
node may use this Loop contract for local repetition; Graph width does not
replace finite Loop depth.
</intake>
<unknowns_gate>
Classify unknowns as known, probeable, testable, or blocked. Missing objective, verifier, permission boundary, budget, or recovery is NEEDS_INPUT; do not infer these controls from intent. Unknown implementation details may be resolved inside the loop only when the probe is bounded and reversible.
</unknowns_gate>
<execute>
Write this contract before acting:
Objective: Mode: Goal | Loop | Automation | AutoResearch
Trigger: Scope: Non-goals:
Owner: Inputs:
Artifacts path: State path: Work clock:
Success metric: Evidence: Verifier:
Topology: single-agent | maker-checker | manager-workers
Max iterations: Time limit: Budget:
Review budget: Stop condition:
Write-back: Permission boundary: Recovery:
Validate it with scripts/validate_loop_contract.py --strict. Then iterate:
Use single-agent by default, maker-checker for ambiguous/high-risk evaluation, and manager-workers only for genuinely independent work with an explicit integration gate.
If a validated Graph owns the dependency topology, this skill owns only the
bounded retry behavior inside its declared loop nodes.
</execute>
<evaluate>
The verifier must test the declared result rather than reward activity. Check evidence freshness, metric movement, guardrails, scope, and state replay. For external or consequential actions, require approval and verified rollback before crossing the boundary.
</evaluate>
<retry_policy>
max_attempts equals the contract's finite max iterations. Retry only after a named diagnosis and a changed input, tool, scope, or strategy. Stop on the same failure signature twice, metric regression, exhausted review budget, or NO_PROGRESS.
</retry_policy>
<state_contract>
Persist {run_id, status, attempt, budget, evidence, unknowns, last_error, next_action} plus contract version, trigger receipt, hypothesis, action, artifact/diff, metric/guardrail delta, permissions, work clock, and recovery point. Append iterations; write current state atomically.
</state_contract>
NEEDS_INPUT: a mandatory contract field is absent; do not start.BLOCKED_PERMISSION: the next action crosses authority; checkpoint and request approval.VERIFY_FAILED: result or guardrail fails; rollback/regroup before another attempt.NO_PROGRESS: the same signature repeats or the metric is unchanged after a changed attempt.BUDGET_STOP: any iteration, time, tool, cost, or review cap fires. max_attempts is always finite.Return status, result (metric/end-state decision), evidence (validator and iteration receipts), unknowns, and next_action (stop, retry, approval, recovery, or handoff).
VERIFY_FAILED; never optimize the headline metric alone.</skill_contract>
Assists in writing high-quality content by conducting research, adding citations, improving hooks, iterating on outlines, and providing real-time feedback on each section. Transforms your writing process from solo effort to collaborative partnership.
Identifies high-quality leads for your product or service by analyzing your business, searching for target companies, and providing actionable contact strategies. Perfect for sales, business development, and marketing professionals.
Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.
Efficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.
Query and analyze scholarly literature using the OpenAlex database. This skill should be used when searching for academic papers, analyzing research trends, finding works by authors or institutions, tracking citations, discovering open access publications, or conducting bibliometric analysis across 240M+ scholarly works. Use for literature searches, research output analysis, citation analysis, and academic database queries.
Access USPTO APIs for patent/trademark searches, examination history (PEDS), assignments, citations, office actions, TSDR, for IP analysis and prior art searches.
Multiagent AI system for scientific research assistance that automates research workflows from data analysis to publication. This skill should be used when generating research ideas from datasets, developing research methodologies, executing computational experiments, performing literature searches, or generating publication-ready papers in LaTeX format. Supports end-to-end research pipelines with customizable agent orchestration.
Automated LLM-driven hypothesis generation and testing on tabular datasets. Use when you want to systematically explore hypotheses about patterns in empirical data (e.g., deception detection, content analysis). Combines literature insights with data-driven hypothesis testing. For manual hypothesis formulation use hypothesis-generation; for creative ideation use scientific-brainstorming.
Take mark393295827/loop-engineering from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.