# How i-have-adhd Ensures a Concrete Next Action at the End of Every Response

> Learn how i-have-adhd ensures a concrete next action in every response. Discover the skill's explicit output rules and runtime enforcement for clear guidance.

- Repository: [Ayoub Ghriss/i-have-adhd](https://github.com/ayghri/i-have-adhd)
- Tags: how-to-guide
- Published: 2026-08-25

---

**The i-have-adhd skill guarantees a concrete next action by hard-coding explicit output rules in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) and enforcing them through the OpenCode runtime's pre-generation prompt injection and post-generation output validation.**

The ayghri/i-have-adhd repository implements a systematic approach to AI-assisted task management by architecting every response to terminate with a concrete next action. This design pattern ensures users always receive an immediately executable step that can be completed in under two minutes, eliminating decision paralysis. The enforcement mechanism combines markdown-based rule definitions with runtime validation to programmatically reject any output that lacks a definitive ending.

## The Dual Rule System for Concrete Next Actions

The skill definition establishes two complementary constraints that govern response structure. These rules are parsed at session initialization and persisted throughout the entire conversation.

### Lead with the Next Action

According to [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) (lines 33-41), every response must begin with an actionable item the reader can perform immediately. This constraint eliminates preamble and forces the model to prioritize executable commands, file paths, or code snippets at the very beginning of the output.

### End with One Concrete Next Action

The same skill file (lines 57-63) mandates that after any explanation, the response must finish with a single, clearly-defined step. This final action must be completable in under two minutes, providing a low-friction pathway for the user to maintain momentum. The rule explicitly prohibits vague conclusions or multiple conflicting options.

## How the OpenCode Runtime Enforces These Rules

The enforcement mechanism operates through four distinct phases that transform the static markdown rules into active constraints on model generation.

**Skill Loading:** At session start, the runtime reads [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) and stores the next-action constraints in the agent's persistent context.

**Prompt Construction:** When generating a response, the system prepends a system prompt derived from [`.opencode/command/i-have-adhd.md`](https://github.com/ayghri/i-have-adhd/blob/main/.opencode/command/i-have-adhd.md) that injects the directives "Lead with the next action" and "End with one concrete next action" into the model's instruction set.

**Output Validation:** After text generation, a post-processing validator scans the output stream. The validator checks that the first line contains an actionable command and the final line contains a single concrete step. If either validation fails, the output is discarded and the model regenerates until compliance is achieved.

**Session Persistence:** The rule set remains active for the entire session duration, ensuring that every subsequent turn adheres to the same structural pattern regardless of conversation length or topic drift.

## Code Examples of the Next Action Pattern

The following examples demonstrate how the dual-rule system manifests in actual outputs:

```markdown
**Example 1 – Direct command response**

Run `npm install jsonwebtoken`, then edit `src/auth.ts:42`.

> ✅ First line is the actionable command.  
> ✅ No extra preamble; the next‑action rule satisfied.

```

```markdown
**Example 2 – Multi‑step with final concrete action**

1. Open `src/auth.ts`.
2. Replace the `verifyToken` function (lines 42‑58) with the snippet below.
3. Run `npm test -- auth.spec.ts`.

Next: run `npm test` and paste the first failing line.

```

In Example 2, the initial numbered list satisfies the "lead with the next action" rule by providing immediate file operations, while the final line ("Next: run `npm test`...") satisfies the "end with one concrete next action" rule by offering a succinct, under‑two‑minute step.

## Summary

- **Rule Definition:** The concrete next action requirement is hard-coded in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) (lines 57-63).
- **Dual Enforcement:** The system requires both a leading action (lines 33-41) and a trailing concrete action in every response.
- **Runtime Validation:** The OpenCode command validates output structure through [`.opencode/command/i-have-adhd.md`](https://github.com/ayghri/i-have-adhd/blob/main/.opencode/command/i-have-adhd.md) before delivery.
- **Automatic Correction:** Outputs failing validation are rejected and regenerated until they include a compliant concrete next action.
- **Test Coverage:** The validation logic is verified by `tests/opencode_plugin_driver.mjs`.

## Frequently Asked Questions

### What file defines the concrete next action rules?

The rules are defined in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md), specifically in the sections spanning lines 33-41 (leading action) and lines 57-63 (trailing concrete action). This markdown file serves as the canonical configuration that the OpenCode runtime parses at session initialization.

### How does the runtime know if a next action is "concrete" enough?

The validator checks for specific actionable patterns such as shell commands, file paths, or direct instructions in the final line. The underlying heuristic, implemented in the post-generation scanning logic, requires that the step be completable in under two minutes and specify exactly one operation without ambiguity.

### What happens if the model generates a response without a next action?

If the post-processing validator detects a missing or insufficient next action, the output is discarded before reaching the user. The runtime then triggers a regeneration request with reinforced instructions from [`.opencode/command/i-have-adhd.md`](https://github.com/ayghri/i-have-adhd/blob/main/.opencode/command/i-have-adhd.md) until the output satisfies both the leading and trailing action constraints.

### Where is the validation logic tested?

The enforcement mechanism is verified by the test suite in `tests/opencode_plugin_driver.mjs`, which simulates various output patterns to ensure the runtime correctly identifies and rejects responses that violate the concrete next action rule.