@alexandrealvaro/agentic 0.12.0-beta.1 → 0.14.0-beta.1
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.
- package/README.md +18 -4
- package/WORKFLOW.md +100 -9
- package/package.json +1 -1
- package/src/commands/init.js +1 -0
- package/src/lib/profiles.js +4 -1
- package/src/lib/rootdoc.js +4 -2
- package/src/skills/claude-code/agentic-bootstrap/SKILL.md +1 -1
- package/src/skills/claude-code/agentic-next/SKILL.md +17 -10
- package/src/skills/claude-code/agentic-spec/SKILL.md +2 -2
- package/src/skills/claude-code/agentic-tdg/SKILL.md +126 -0
- package/src/skills/codex/agentic-bootstrap/SKILL.md +1 -1
- package/src/skills/codex/agentic-next/SKILL.md +15 -10
- package/src/skills/codex/agentic-next/agents/openai.yaml +1 -1
- package/src/skills/codex/agentic-spec/SKILL.md +2 -2
- package/src/skills/codex/agentic-tdg/SKILL.md +109 -0
- package/src/skills/codex/agentic-tdg/agents/openai.yaml +5 -0
package/README.md
CHANGED
|
@@ -33,14 +33,15 @@ Two categories ([ADR-0007](doc/adr/0007-workflow-operational-skills.md)) and two
|
|
|
33
33
|
| `agentic-bootstrap` | spec-driven | universal | Scans the repo, writes `AGENTS.md` ≤150 lines | `/agentic-bootstrap` |
|
|
34
34
|
| `agentic-architecture` | spec-driven | universal | Scans the code, writes `ARCHITECTURE.md` | `/agentic-architecture` |
|
|
35
35
|
| `agentic-adr` | spec-driven | universal | Drafts `doc/adr/NNNN-<slug>.md` from the conversation | `/agentic-adr` |
|
|
36
|
-
| `agentic-spec` | spec-driven | universal | Drafts `doc/specs/NNNN-<slug>.md` — feature-level spec (User Scenarios, Requirements, Success Criteria) layer
|
|
36
|
+
| `agentic-spec` | spec-driven | universal | Drafts `doc/specs/NNNN-<slug>.md` — feature-level spec (User Scenarios, Requirements, Success Criteria) layer 3 of the five-layer stack | `/agentic-spec` |
|
|
37
37
|
| `agentic-task` | spec-driven | universal | Drafts `doc/tasks/NNNN-<slug>.md` (checkbox + Notes format; carries `Spec ref` to link the implementing spec) | `/agentic-task` |
|
|
38
38
|
| `agentic-audit` | spec-driven | universal | Read-only drift report (AGENTS.md / ARCHITECTURE.md / ADRs) | `/agentic-audit` |
|
|
39
39
|
| `agentic-philosophy` | workflow-operational | universal | Universal agent guardrails — auto-loads on non-trivial work | implicit |
|
|
40
40
|
| `agentic-review` | workflow-operational | universal | Fresh-context code review per WORKFLOW §10; structured findings, no "approve" | `/agentic-review <range>` |
|
|
41
41
|
| `agentic-ground` | workflow-operational | universal | Four-source pre-implementation research (docs / OSS / in-repo / git history) + happy-path synthesis + deviation gate per WORKFLOW §4 + §5 | `/agentic-ground` |
|
|
42
|
-
| `agentic-next` | workflow-operational | universal | State-aware navigation aid (`flutter doctor` pattern) — surveys the
|
|
42
|
+
| `agentic-next` | workflow-operational | universal | State-aware navigation aid (`flutter doctor` pattern) — surveys the five-layer artifact stack and recommends prioritized next actions; complements `agentic-audit` (drift) | `/agentic-next` |
|
|
43
43
|
| `agentic-spike` | workflow-operational | universal | Staged spike with golden fixtures per WORKFLOW §14, for cases where the *technique* is uncertain across multiple plausible approaches; produces `spikes/NNNN-<slug>/` with discovery + fixture + pipeline-with-gates + two-layer evaluation | `/agentic-spike` |
|
|
44
|
+
| `agentic-tdg` | workflow-operational | universal | Outcome-based prompting per WORKFLOW §9 — ground truth pair + Test Dependency Map + three approaches + single-criterion selection, for cases where the technique is known but the implementation strategy is uncertain | `/agentic-tdg` |
|
|
44
45
|
| `agentic-design` | spec-driven | auto if frontend detected | Bootstrap `DESIGN.md` from existing tokens (Figma, tailwind.config, tokens.json, CSS custom props) | `/agentic-design` |
|
|
45
46
|
| `agentic-subagent` | spec-driven | auto if installing for Claude Code | Drafts `.claude/agents/<name>.md` (Claude Code only — Codex has no subagent primitive) | `/agentic-subagent` |
|
|
46
47
|
| `agentic-skill` | spec-driven | opt-in only | Drafts a new Claude Code or Codex skill at the appropriate path | `/agentic-skill` |
|
|
@@ -50,6 +51,17 @@ A short TUI shows the detected mode, agent, and feature signals (frontend / `.cl
|
|
|
50
51
|
|
|
51
52
|
If your project already has an `AGENTS.md` (or `CLAUDE.md`), the installer appends a managed `Skills installed by agentic` section bracketed by `<!-- agentic-managed-skills:start -->` / `:end -->` markers. User content outside those markers is byte-preserved; re-runs update only the managed block.
|
|
52
53
|
|
|
54
|
+
### Planned skills
|
|
55
|
+
|
|
56
|
+
Skills accepted by ADR but not yet implemented; tracked under [task-0020](doc/tasks/0020-mattpocock-absorptions.md). Each ships in its own minor release.
|
|
57
|
+
|
|
58
|
+
| Skill | Target | Operationalizes | ADR |
|
|
59
|
+
| --- | --- | --- | --- |
|
|
60
|
+
| `agentic-domain` | v0.15.x | Lazy-creates / updates `CONTEXT.md` (Layer 2 — ubiquitous language per Evans 2003) | [ADR-0019](doc/adr/0019-domain-language-layer.md) |
|
|
61
|
+
| `agentic-grill` | v0.16.x | Interview-before-research session, upstream of `agentic-ground` | (forthcoming) |
|
|
62
|
+
| `agentic-deepen` | v0.17.x | Surfaces deepening opportunities using the Ousterhout/Feathers vocabulary | [ADR-0020](doc/adr/0020-deep-modules-vocabulary.md) |
|
|
63
|
+
| `agentic-diagnose` | v0.18.x | Five-phase debugging discipline per WORKFLOW §15 | [ADR-0021](doc/adr/0021-diagnose-discipline.md) |
|
|
64
|
+
|
|
53
65
|
## Project maturity profiles
|
|
54
66
|
|
|
55
67
|
The kit ships four profiles that select which skills auto-install. Same WORKFLOW principles bind every profile; only the artifact set scales.
|
|
@@ -154,10 +166,12 @@ The kit ships nine universal skills plus three conditional ones — twelve discr
|
|
|
154
166
|
|
|
155
167
|
The kit's discipline scales with the project's maturity. A solo PoC may legitimately skip `/agentic-spec` and `/agentic-adr` (the WORKFLOW §1 prune principle applies — don't add an artifact that wouldn't change agent behavior). A team product running on this kit is expected to use the full sequence and additionally invoke `/agentic-hooks` once to scaffold the deterministic gates per WORKFLOW §11 (pre-commit lint / format / secret-scan; pre-push build / unit / integration). Project maturity profiles that automate the recommendation by stack are deferred — see the next planned release.
|
|
156
168
|
|
|
157
|
-
**Lost mid-flow?** Invoke `/agentic-next` at any time to survey the project's state across the
|
|
169
|
+
**Lost mid-flow?** Invoke `/agentic-next` at any time to survey the project's state across the five-layer artifact stack (Constitution → Domain → Spec → Plan/Decisions → Code) and get prioritized next-action recommendations. Read-only; complements `/agentic-audit` (drift detection — different question).
|
|
158
170
|
|
|
159
171
|
**Technique uncertain across multiple plausible approaches?** Invoke `/agentic-spike` (per WORKFLOW §14) when the spec is clear but the *how* is unknown — library choice, multi-stage transformation, novel domain. The skill scaffolds a staged spike with golden fixtures + per-stage debug artifacts + two-layer evaluation under `spikes/NNNN-<slug>/`. The directory is throwaway by design; conclude with `/agentic-adr` and delete.
|
|
160
172
|
|
|
173
|
+
**Technique known but implementation strategy uncertain?** Invoke `/agentic-tdg` (per WORKFLOW §9) when multiple algorithms could produce the expected output with different trade-offs along readability / performance / testability. The skill forces a ground-truth pair, lists the tests covering the file (Test Dependency Map), generates three implementation candidates, and commits to one by a single named criterion — refusing the "optimize for all three at once" failure mode. No file written; the verified implementation is the artifact, with the candidate set + criterion landing in the commit message body.
|
|
174
|
+
|
|
161
175
|
## Manual prompts
|
|
162
176
|
|
|
163
177
|
If you prefer to skip the installer, the same artifacts can be generated by pasting prompts directly into your agent. Each prompt file has the literal text to copy, plus the matching template structure:
|
|
@@ -193,7 +207,7 @@ Prompts reference templates by relative path. Two ways to give your agent access
|
|
|
193
207
|
|
|
194
208
|
**Researching before implementation.** Run `/agentic-ground` (or let it auto-trigger on non-trivial work). The skill runs a four-source research pass — official docs, validated open-source examples, in-repo patterns, and git history — synthesizes a happy path with citations from each source, and gates any deviation behind an irrefutable justification before code is written (WORKFLOW §4 + §5). Output is the input to whatever produces the implementation plan; the skill does not write code.
|
|
195
209
|
|
|
196
|
-
**Specifying a feature.** Run `/agentic-spec` (or `/agentic-spec` with a feature name). The skill scaffolds `doc/specs/NNNN-<slug>.md` with industry-aligned mandatory sections (User Scenarios, Functional / Non-functional Requirements, Success Criteria, Edge Cases, Out of Scope, Open Questions, Related). Specs are layer
|
|
210
|
+
**Specifying a feature.** Run `/agentic-spec` (or `/agentic-spec` with a feature name). The skill scaffolds `doc/specs/NNNN-<slug>.md` with industry-aligned mandatory sections (User Scenarios, Functional / Non-functional Requirements, Success Criteria, Edge Cases, Out of Scope, Open Questions, Related). Specs are layer 3 of the five-layer artifact stack — Constitution → Domain → Spec → Plan/Decisions → Code. One spec per feature; multiple tasks (`/agentic-task`) implement one spec; the task template carries a `Spec ref` field linking back to the spec.
|
|
197
211
|
|
|
198
212
|
**Project already built with agents.** Treat missing artifacts as brownfield (run the relevant skill) and existing artifacts as audit (`/agentic-audit`).
|
|
199
213
|
|
package/WORKFLOW.md
CHANGED
|
@@ -4,7 +4,7 @@ Engineering production code with LLMs. Agentic, not vibe coding.
|
|
|
4
4
|
|
|
5
5
|
**The Steve Rogers framing.** The LLM is the super-soldier serum. The engineer is Steve Rogers. The serum amplifies what the engineer already brings — solid bases, organization, investigation, care for quality, architecture, clean code, documentation, observability, maintainability. Add the serum to a disciplined engineer and you get Captain America. Add it to an undisciplined one and you get faster sloppy at scale. This document is those bases written down as principles. The discipline is the input; the LLM is the amplifier; the kit (skills, ADRs, audits, gates) is the scaffolding that keeps the discipline intact across sessions, agents, and projects.
|
|
6
6
|
|
|
7
|
-
**The principle behind the rest:** context engineering beats prompt engineering. Context is finite and decays as it fills — aim for the smallest set of high-signal tokens that gets the outcome.
|
|
7
|
+
**The principle behind the rest:** context engineering beats prompt engineering. Context is finite and decays as it fills — aim for the smallest set of high-signal tokens that gets the outcome. Operationally: one task per session, reset rather than extend. A long-running conversation crosses from the model's high-precision zone into a low-precision one as the cross-references multiply; smaller, deliberately-loaded contexts beat larger, accreted ones.
|
|
8
8
|
|
|
9
9
|
## TL;DR
|
|
10
10
|
|
|
@@ -27,7 +27,10 @@ What to keep in mind:
|
|
|
27
27
|
13. **Automation needs rails.** Hooks, tests, lint, CI, sandboxing, and permissions matter more than advisory text the agent can forget.
|
|
28
28
|
14. **Autonomy requires observability.** If the agent makes decisions, log the trajectory: tool calls, intermediate outputs, failures.
|
|
29
29
|
15. **Staged spikes when the technique is uncertain.** When the *how* is unknown — a library choice, a CV technique, a multi-stage transformation — break the problem into staged spikes against golden fixtures with per-stage debug artifacts.
|
|
30
|
-
16. **
|
|
30
|
+
16. **Diagnose with discipline.** For hard bugs and performance regressions: build a fast, deterministic feedback loop *before* hypothesising. Reproduce, then generate three to five ranked falsifiable hypotheses, then change one variable at a time. The feedback loop is the skill; everything else is mechanical.
|
|
31
|
+
17. **One task per session.** Context decays as it fills. Reset and reload only what the next task needs rather than extending a long conversation across many features. Smaller, deliberately-loaded contexts beat large, accreted ones.
|
|
32
|
+
18. **Slice vertically, not horizontally.** Decompose a spec into thin end-to-end paths through every layer (schema, API, UI, tests) rather than one layer at a time. Each slice ships demonstrable behavior; horizontal layer-stacks ship nothing on their own.
|
|
33
|
+
19. **Discipline scales with project maturity.** Same principles bind every project; the artifact set scales. A spike runs posture + research + audit; a regulated product adds spec / ADR / hooks / evals. Add ceremony only where it changes agent behavior; configure at init and reconfigure as the project matures.
|
|
31
34
|
|
|
32
35
|
> Working with agents means trading typing for technical direction. The value is in giving the right context, setting boundaries, validating the result, and keeping "almost right" out of production.
|
|
33
36
|
|
|
@@ -37,14 +40,15 @@ Define the rules before the agent writes a line. The temptation is to dump every
|
|
|
37
40
|
|
|
38
41
|
There are two complementary frames for the artifacts the kit produces. The first is **purpose** — what each artifact is *for*. The second is **loading mechanism** — when each artifact reaches the agent's context.
|
|
39
42
|
|
|
40
|
-
###
|
|
43
|
+
### Five-layer artifact stack (purpose)
|
|
41
44
|
|
|
42
45
|
1. **Constitution** — `AGENTS.md` (operational guide) and `WORKFLOW.md` (engineering philosophy). Tells the agent how the project works and how the team thinks. Read every session.
|
|
43
|
-
2. **
|
|
44
|
-
3. **
|
|
45
|
-
4. **
|
|
46
|
+
2. **Domain** — `CONTEXT.md` at the repo root (or `CONTEXT-MAP.md` plus per-context `CONTEXT.md` files for multi-context repos). The project's ubiquitous language: canonical nouns, the aliases to avoid, the relationships between them, and the ambiguities that have already been resolved. Direct application of Domain-Driven Design (Evans, 2003) — when an agent and a human share the project's vocabulary, the agent uses fewer tokens to say more, and the code, tests, and conversation all converge on the same names. Created lazily — first term resolved triggers the file. ADR-0019 records the layer.
|
|
47
|
+
3. **Spec** — `doc/specs/NNNN-<slug>.md`. Feature-level requirements: who the feature is for, what it must do, the measurable success criteria, the explicit non-goals. One spec per feature; multiple tasks implement one spec; ADRs may be driven by spec constraints. Industry-aligned with [GitHub Spec Kit](https://github.com/github/spec-kit).
|
|
48
|
+
4. **Plan / Decisions** — `ARCHITECTURE.md` (system patterns and boundaries), `doc/adr/NNNN-*.md` (binding architectural decisions in Michael Nygard's pattern), `doc/tasks/NNNN-*.md` (per-work-unit plan with checkbox acceptance criteria). The *how* of building what the spec asked for.
|
|
49
|
+
5. **Code** — the implementation. Code is the primary documentation of behavior; comments justify non-obvious choices.
|
|
46
50
|
|
|
47
|
-
The
|
|
51
|
+
The five layers scale with project maturity (TL;DR #19 — Discipline scales). A spike or PoC profile may legitimately ship only Layers 1, 2, and 5 — adding Layers 3 and 4 to a 200-line experiment is ceremony that does not change agent behavior. (Domain — Layer 2 — earns its keep even at PoC because vocabulary drift starts on day one.) A team or regulated product runs all five. The kit's profiles (`poc`, `solo`, `team`, `mature`) configure which layers auto-install per project and are changeable as the project matures; the principles in this document bind every profile, only the artifact set differs.
|
|
48
52
|
|
|
49
53
|
### Three context types (loading mechanism)
|
|
50
54
|
|
|
@@ -52,9 +56,10 @@ The four layers scale with project maturity (TL;DR #16). A spike or PoC profile
|
|
|
52
56
|
- **Canonical specs are constraints, not advice.** `DESIGN.md` (the visual contract — YAML tokens plus Markdown rationale, per Google Labs' open standard), `ARCHITECTURE.md`, ADRs in `doc/adr/*.md`, and feature specs in `doc/specs/*.md` are facts the agent must obey. If a token, pattern, or success criterion isn't declared here, it doesn't exist. The agent must never invent one.
|
|
53
57
|
- **On-demand context is `SKILL.md`.** Description loads at session start (the listing is capped at 1,536 characters per the spec) and body loads only when the skill is invoked. Use it for repeatable workflows or domain knowledge that shouldn't pay a token cost on every turn.
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
Three rules apply across all of the above:
|
|
56
60
|
|
|
57
61
|
- **Acceptance criteria must be measurable.** "Build a dashboard" fails. "Loads in under 2 seconds, shows 6 months of history, passes axe accessibility" succeeds.
|
|
62
|
+
- **Acceptance criteria must be durable, not procedural.** Describe the behavior and the interfaces — the contracts that survive a rename. Avoid file paths, line numbers, and "open file X and add line Y" wording in the criteria themselves; those rot the moment the implementation moves. Procedural execution steps belong in a separate section of the task file, not in the criteria.
|
|
58
63
|
- **Prune.** If removing a line wouldn't make the agent fail, cut it.
|
|
59
64
|
|
|
60
65
|
## 2. Docs vs. Code
|
|
@@ -112,7 +117,7 @@ The kit ships `agentic-ground` as the workflow-operational implementation of bot
|
|
|
112
117
|
For non-trivial changes, four phases:
|
|
113
118
|
|
|
114
119
|
1. **Explore (read-only).** Plan mode in your agent. Read, build a mental model, no edits.
|
|
115
|
-
2. **Plan.** Agent writes a Markdown plan. You edit before approving. For non-trivial multi-step work, structure the plan as a per-task file (`doc/tasks/<NNNN>-<slug>.md`) with checkbox acceptance criteria and execution steps — the agent toggles checkboxes as it works rather than rewriting paragraphs, keeping edits cheap and resumable across sessions.
|
|
120
|
+
2. **Plan.** Agent writes a Markdown plan. You edit before approving. For non-trivial multi-step work, structure the plan as a per-task file (`doc/tasks/<NNNN>-<slug>.md`) with checkbox acceptance criteria and execution steps — the agent toggles checkboxes as it works rather than rewriting paragraphs, keeping edits cheap and resumable across sessions. When a spec yields more than one task, **slice vertically**: each task is a thin end-to-end path through every layer the change touches (schema, API, UI, tests), not one layer at a time. The anti-pattern is *horizontal slicing* — "first the schema task, then the API task, then the UI task" — because nothing is shippable until the last task lands. Tracer-bullet vertical slices each ship a demonstrable behavior on their own ([Hunt & Thomas, *Pragmatic Programmer*, 1999](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)). Tag each task **AFK** (specified completely enough that an autonomous agent can land it) or **HITL** (needs human judgment, taste, design review, or external access) — the dimension is orthogonal to the lifecycle status and tells parallel agents which work is theirs to take.
|
|
116
121
|
3. **Implement.** Execute the approved plan; verify each step before moving to the next.
|
|
117
122
|
4. **Commit.** One logical change per commit.
|
|
118
123
|
|
|
@@ -135,6 +140,27 @@ Lock the load-bearing decisions into `AGENTS.md` or `CLAUDE.md` so the agent doe
|
|
|
135
140
|
|
|
136
141
|
The agent will follow what's specified and invent what isn't. Prefer specifying.
|
|
137
142
|
|
|
143
|
+
### Architectural vocabulary
|
|
144
|
+
|
|
145
|
+
Architectural drift accelerates with the agent's typing speed; the counter is shared vocabulary that names the shapes that matter. The kit adopts the canonical terms from John Ousterhout's *A Philosophy of Software Design* (2018) and Michael Feathers's *Working Effectively with Legacy Code* (2004), and uses them in `ARCHITECTURE.md`, ADRs, and architecture-touching skills (ADR-0020).
|
|
146
|
+
|
|
147
|
+
- **Module** — anything with an interface and an implementation; deliberately scale-agnostic (function, class, package, vertical slice).
|
|
148
|
+
- **Interface** — everything a caller must know to use the module correctly: types, invariants, ordering constraints, error modes, configuration, performance characteristics. *Not* just the type signature.
|
|
149
|
+
- **Implementation** — what's inside the module.
|
|
150
|
+
- **Depth** — leverage at the interface. A module is **deep** when a large amount of behavior sits behind a small interface; **shallow** when the interface is nearly as complex as the implementation. Depth is a property of the interface, not of line counts (rejected framing: depth-as-implementation-to-interface line ratio rewards padding).
|
|
151
|
+
- **Seam** (Feathers) — a place where behavior can be altered without editing in place; the *location* of an interface. Distinct from DDD's *bounded context*; the kit avoids "boundary" for this reason.
|
|
152
|
+
- **Adapter** — a concrete thing that satisfies an interface at a seam; a role, not a substance.
|
|
153
|
+
- **Leverage** — what callers get from depth: more capability per unit of interface they have to learn.
|
|
154
|
+
- **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated at one place rather than spread across callers.
|
|
155
|
+
|
|
156
|
+
Three principles fall out of those terms:
|
|
157
|
+
|
|
158
|
+
- **Deletion test.** Imagine deleting the module. If complexity vanishes, the module was a pass-through (delete it). If complexity reappears across N callers, it was earning its keep.
|
|
159
|
+
- **The interface is the test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.
|
|
160
|
+
- **One adapter is a hypothetical seam; two adapters make it real.** Don't introduce a seam unless something actually varies across it.
|
|
161
|
+
|
|
162
|
+
Skills that touch architecture (`agentic-architecture`, `agentic-adr`, the planned `agentic-deepen`) use these terms verbatim, so suggestions and reviews land in a single language.
|
|
163
|
+
|
|
138
164
|
## 9. Outcome-Based Prompting (TDG)
|
|
139
165
|
|
|
140
166
|
Give the finish line first, not the path:
|
|
@@ -172,6 +198,8 @@ The takeaway: §10 (Reviewer) and §11 (Quality Gates) are not optional. Skippin
|
|
|
172
198
|
|
|
173
199
|
Per the Steve Rogers framing in the preamble: the serum cannot manufacture discrimination — it amplifies whatever discrimination the engineer already brings. The kit's job is to encode discrimination into the agent's context (specs, ADRs, fresh-context reviews, deterministic gates) so the amplification compounds in the disciplined direction even when the engineer is sleepy, rushed, or handing off to another collaborator.
|
|
174
200
|
|
|
201
|
+
**Two roles of judgment, not one.** Agent review (§10 fresh-context) and the deterministic gates (§11) catch the *mechanical* failures: bugs, coupling, edge cases, broken contracts, missed branches. They do not — and should not be expected to — catch what is left after that: taste, product judgment, visual feel, whether the feature actually solves the user's problem. Those require a human to look at the running thing and form an opinion. Skipping fresh-context review because "the engineer will catch it" wastes engineer attention on mechanical failures the agent should have caught. Skipping the human pass because "the agent reviewed it" ships features that compile, pass, and feel wrong. The two are complements, not substitutes.
|
|
202
|
+
|
|
175
203
|
## 13. Evals for Anything Autonomous
|
|
176
204
|
|
|
177
205
|
If your agent is making decisions on its own, you need evals. A few principles:
|
|
@@ -185,6 +213,8 @@ If your agent is making decisions on its own, you need evals. A few principles:
|
|
|
185
213
|
|
|
186
214
|
Sometimes the spec is clear but the *technique* is uncertain — you don't know which library, which CV approach, which decomposition. Don't ask the agent to solve it end-to-end. Break the problem into staged spikes and validate each one against curated ground truth.
|
|
187
215
|
|
|
216
|
+
**Spike vs. prototype.** Use a *spike* (this section) when the unknown is *how* — the technique itself is uncertain across multiple plausible approaches and validation needs golden fixtures with per-stage debug. Use a *prototype* when the unknown is *what should this feel like* — UI/UX direction, the shape of an interaction, whether a state model holds up under play. Different question, different artifact, different success criterion.
|
|
217
|
+
|
|
188
218
|
The flow has four parts:
|
|
189
219
|
|
|
190
220
|
1. **Discovery first.** Ask the agent to list canonical approaches grounded in official docs and real examples. Pick one by an explicit criterion. The output of this step is information, not code.
|
|
@@ -198,6 +228,53 @@ The flow has four parts:
|
|
|
198
228
|
|
|
199
229
|
This is a combination of established practices, not new terminology: spike (XP), golden datasets, stage-segmented error analysis, trajectory evaluation, and visual debugging in CV pipelines.
|
|
200
230
|
|
|
231
|
+
## 15. Diagnose With Discipline
|
|
232
|
+
|
|
233
|
+
For hard bugs and performance regressions, the failure mode is jumping to hypotheses before there is a way to check them. The discipline below is the counter; it owes its shape to standard debugging practice (Kernighan & Pike, *The Practice of Programming*, 1999) and the kit ships `agentic-diagnose` as the operational implementation (ADR-0021).
|
|
234
|
+
|
|
235
|
+
### Phase 1 — Build a feedback loop
|
|
236
|
+
|
|
237
|
+
This is *the* skill. Everything else is mechanical. A fast, deterministic, agent-runnable pass/fail signal for the bug is what makes bisection, hypothesis-testing, and instrumentation effective; without one, no amount of staring at code converges. Spend disproportionate effort here.
|
|
238
|
+
|
|
239
|
+
Loop-construction techniques, in roughly increasing cost:
|
|
240
|
+
|
|
241
|
+
1. Failing test at whatever seam reaches the bug — unit, integration, e2e.
|
|
242
|
+
2. Curl / HTTP script against a running dev server.
|
|
243
|
+
3. CLI invocation with a fixture input, diffing stdout against a known-good snapshot.
|
|
244
|
+
4. Headless browser script (Playwright / Puppeteer) — drives the UI, asserts on DOM, console, network.
|
|
245
|
+
5. Replay a captured trace — saved network request, payload, event log — through the code path in isolation.
|
|
246
|
+
6. Throwaway harness — a minimal subset of the system that exercises the bug code path with one function call.
|
|
247
|
+
7. Property / fuzz loop — when the bug is "sometimes wrong output", run many random inputs and look for the failure mode.
|
|
248
|
+
8. Bisection harness — automate "boot at state X, check, repeat" so `git bisect run` works.
|
|
249
|
+
9. Differential loop — run the same input through two versions or two configs and diff outputs.
|
|
250
|
+
10. HITL bash script — last resort. Structure the human's clicks so the loop is still repeatable.
|
|
251
|
+
|
|
252
|
+
Treat the loop as a product: faster, sharper signal, more deterministic, every iteration. A two-second deterministic loop is a debugging superpower; a thirty-second flaky loop is barely better than no loop.
|
|
253
|
+
|
|
254
|
+
For non-deterministic bugs, the goal is not a clean repro but a *higher reproduction rate* — loop the trigger, parallelize, narrow timing windows, inject sleeps. A 50%-flake is debuggable; 1% is not.
|
|
255
|
+
|
|
256
|
+
If a loop genuinely cannot be built, stop and say so — do not proceed to hypotheses.
|
|
257
|
+
|
|
258
|
+
### Phase 2 — Reproduce
|
|
259
|
+
|
|
260
|
+
Run the loop. Confirm the failure matches the user's description (not a different failure that happens to be nearby), reproduces consistently (or at a high enough rate), and the exact symptom is captured for later phases to verify the fix against. Wrong bug = wrong fix.
|
|
261
|
+
|
|
262
|
+
### Phase 3 — Hypothesise
|
|
263
|
+
|
|
264
|
+
Generate **three to five ranked hypotheses** before testing any of them. Single-hypothesis generation anchors on the first plausible idea.
|
|
265
|
+
|
|
266
|
+
Each hypothesis must be **falsifiable**: state the prediction it makes — *"if X is the cause, then changing Y will make the bug disappear / changing Z will make it worse."* If you cannot state the prediction, the hypothesis is a vibe; sharpen it or discard it.
|
|
267
|
+
|
|
268
|
+
Show the ranked list to the user before testing. Domain knowledge often re-ranks instantly ("we just deployed a change to #3"), or marks hypotheses already ruled out — a cheap checkpoint, big time saver.
|
|
269
|
+
|
|
270
|
+
### Phase 4 — Instrument
|
|
271
|
+
|
|
272
|
+
Each probe maps to a specific prediction from Phase 3. Change one variable at a time. Log enough that the result is unambiguous — a single instrument that confirms two predictions at once tends to confirm whichever one you were rooting for.
|
|
273
|
+
|
|
274
|
+
### Phase 5 — Fix and regression-test
|
|
275
|
+
|
|
276
|
+
Apply the fix. Re-run the Phase-1 loop and confirm the captured symptom is gone. Promote the loop's check into a permanent test that lives next to the code so the same failure mode cannot return silently.
|
|
277
|
+
|
|
201
278
|
---
|
|
202
279
|
|
|
203
280
|
These are starting points. Prune what doesn't fit your codebase.
|
|
@@ -214,6 +291,8 @@ This is not theory I read and copied. Most of the practices here come from years
|
|
|
214
291
|
|
|
215
292
|
**§14 (Staged Spikes With Golden Fixtures) is my own working technique.** I haven't seen it documented end-to-end as a single named pattern, but each component (spike, golden dataset, stage-segmented error analysis, trajectory evaluation, visual CV debugging) has its own lineage in the literature listed under Sources. The combination — discovery → fixture → staged pipeline with debug artifacts → two-layer evaluation — is how I attack problems where the *technique* itself is uncertain.
|
|
216
293
|
|
|
294
|
+
**Practices added through cross-pollination.** A second pass over the guide compared this kit's coverage against [Matt Pocock's `mattpocock/skills`](https://github.com/mattpocock/skills) — a separate body of agent-engineering practice grounded in the same canonical literature (DDD, *Pragmatic Programmer*, Ousterhout, Feathers, Beck). The comparison surfaced principles that earned their place in this document on independent merits: the **Domain layer** (§1 Layer 2, ADR-0019) from DDD's ubiquitous-language pattern; the **architectural vocabulary** (§8, ADR-0020) from Ousterhout's depth and Feathers's seams; **Diagnose with discipline** (§15, ADR-0021) from standard debugging practice; **vertical slicing** and **HITL/AFK tagging** (§6) from PragProg's tracer-bullet metaphor; **AI mechanical / human judgment** (§12 second paragraph). Where Pocock's framing sharpened our own — vocabulary or principle that we already gestured at without naming — the borrowed phrasing is acknowledged inline; everything else stays kit-original.
|
|
295
|
+
|
|
217
296
|
External claims (specific percentages, named frameworks) are cited under Sources. Everything else is operational guidance from practice or synthesis across that material — a working model, refined over time, not academic claim.
|
|
218
297
|
|
|
219
298
|
## Sources
|
|
@@ -221,6 +300,14 @@ External claims (specific percentages, named frameworks) are cited under Sources
|
|
|
221
300
|
**§1 — Spec-Driven Design**
|
|
222
301
|
- DESIGN.md spec (Google Labs): https://github.com/google-labs-code/design.md
|
|
223
302
|
- SKILL.md spec (Anthropic): https://code.claude.com/docs/en/skills
|
|
303
|
+
- Domain-Driven Design (Evans, 2003) — *Domain-Driven Design: Tackling Complexity in the Heart of Software*. Source for the Domain layer (`CONTEXT.md`) and the ubiquitous-language discipline.
|
|
304
|
+
|
|
305
|
+
**§6 — Explore → Plan → Implement → Commit**
|
|
306
|
+
- *The Pragmatic Programmer* (Hunt & Thomas, 1999), tracer-bullet metaphor — source for the vertical-slicing principle.
|
|
307
|
+
|
|
308
|
+
**§8 — Architectural Boundaries**
|
|
309
|
+
- *A Philosophy of Software Design* (Ousterhout, 2018) — Module / Interface / Depth vocabulary; rejected framing of depth-as-line-ratio.
|
|
310
|
+
- *Working Effectively with Legacy Code* (Feathers, 2004) — Seam vocabulary.
|
|
224
311
|
|
|
225
312
|
**§12 — The Bottleneck Is Discrimination, Not Generation**
|
|
226
313
|
- JetBrains *DevEcosystem 2025*: https://devecosystem-2025.jetbrains.com/artificial-intelligence
|
|
@@ -232,3 +319,7 @@ External claims (specific percentages, named frameworks) are cited under Sources
|
|
|
232
319
|
- Stage-segmented error analysis — Hamel Husain's evals FAQ: https://hamel.dev/blog/posts/evals-faq/
|
|
233
320
|
- Trajectory evaluation — LangSmith docs: https://docs.langchain.com/langsmith/trajectory-evals
|
|
234
321
|
- Visual CV debugging — OpenCV cvv tutorial: https://docs.opencv.org/3.4/d7/dcf/tutorial_cvv_introduction.html
|
|
322
|
+
|
|
323
|
+
**§15 — Diagnose With Discipline**
|
|
324
|
+
- *The Practice of Programming* (Kernighan & Pike, 1999) — chapters on debugging and testing.
|
|
325
|
+
- Falsifiability framing — Karl Popper, *The Logic of Scientific Discovery* (1959).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexandrealvaro/agentic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0-beta.1",
|
|
4
4
|
"description": "Bootstrap and audit AGENTS.md, ARCHITECTURE.md, ADRs, skills, and subagents for engineering production code with LLMs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/commands/init.js
CHANGED
|
@@ -371,6 +371,7 @@ export async function initCommand(opts) {
|
|
|
371
371
|
'/agentic-ground (WORKFLOW §4 + §5)',
|
|
372
372
|
'/agentic-next (state survey + recommendations)',
|
|
373
373
|
'/agentic-spike (WORKFLOW §14 — staged spike with golden fixtures)',
|
|
374
|
+
'/agentic-tdg (WORKFLOW §9 — outcome-based prompting + TDM)',
|
|
374
375
|
...(optedSkills.includes('agentic-design') ? ['/agentic-design (DESIGN.md)'] : []),
|
|
375
376
|
...(optedSkills.includes('agentic-subagent') && agents.includes('claude-code')
|
|
376
377
|
? ['/agentic-subagent']
|
package/src/lib/profiles.js
CHANGED
|
@@ -20,7 +20,7 @@ export const PROFILE_NAMES = ['poc', 'solo', 'team', 'mature'];
|
|
|
20
20
|
|
|
21
21
|
export const PROFILES = {
|
|
22
22
|
poc: {
|
|
23
|
-
universal: ['agentic-philosophy', 'agentic-ground', 'agentic-audit', 'agentic-next', 'agentic-spike'],
|
|
23
|
+
universal: ['agentic-philosophy', 'agentic-ground', 'agentic-audit', 'agentic-next', 'agentic-spike', 'agentic-tdg'],
|
|
24
24
|
conditional: {
|
|
25
25
|
'agentic-design': 'blocked',
|
|
26
26
|
'agentic-subagent': 'blocked',
|
|
@@ -36,6 +36,7 @@ export const PROFILES = {
|
|
|
36
36
|
'agentic-audit',
|
|
37
37
|
'agentic-next',
|
|
38
38
|
'agentic-spike',
|
|
39
|
+
'agentic-tdg',
|
|
39
40
|
'agentic-bootstrap',
|
|
40
41
|
'agentic-spec',
|
|
41
42
|
'agentic-task',
|
|
@@ -64,6 +65,7 @@ export const PROFILES = {
|
|
|
64
65
|
'agentic-ground',
|
|
65
66
|
'agentic-next',
|
|
66
67
|
'agentic-spike',
|
|
68
|
+
'agentic-tdg',
|
|
67
69
|
],
|
|
68
70
|
conditional: {
|
|
69
71
|
'agentic-design': 'frontend',
|
|
@@ -86,6 +88,7 @@ export const PROFILES = {
|
|
|
86
88
|
'agentic-ground',
|
|
87
89
|
'agentic-next',
|
|
88
90
|
'agentic-spike',
|
|
91
|
+
'agentic-tdg',
|
|
89
92
|
],
|
|
90
93
|
conditional: {
|
|
91
94
|
'agentic-design': 'frontend',
|
package/src/lib/rootdoc.js
CHANGED
|
@@ -18,7 +18,7 @@ export const SKILL_DESCRIPTIONS = {
|
|
|
18
18
|
'agentic-architecture': 'Generate or audit `ARCHITECTURE.md` at the repo root.',
|
|
19
19
|
'agentic-adr': 'Draft a new ADR at `doc/adr/NNNN-<slug>.md`.',
|
|
20
20
|
'agentic-spec':
|
|
21
|
-
'Draft a feature spec at `doc/specs/NNNN-<slug>.md` (Spec Kit-aligned mandatory sections). Layer
|
|
21
|
+
'Draft a feature spec at `doc/specs/NNNN-<slug>.md` (Spec Kit-aligned mandatory sections). Layer 3 of the five-layer artifact stack.',
|
|
22
22
|
'agentic-task': 'Draft a new task at `doc/tasks/NNNN-<slug>.md`.',
|
|
23
23
|
'agentic-audit':
|
|
24
24
|
'Read-only drift report comparing AGENTS.md / ARCHITECTURE.md / ADRs against the code.',
|
|
@@ -27,9 +27,11 @@ export const SKILL_DESCRIPTIONS = {
|
|
|
27
27
|
'agentic-ground':
|
|
28
28
|
'Four-source pre-implementation research (docs / OSS / in-repo / git history) + happy-path synthesis + deviation gate. WORKFLOW §4 + §5.',
|
|
29
29
|
'agentic-next':
|
|
30
|
-
'State survey + prioritized next-action recommendations across the
|
|
30
|
+
'State survey + prioritized next-action recommendations across the five-layer artifact stack. Read-only navigation aid (`flutter doctor` pattern).',
|
|
31
31
|
'agentic-spike':
|
|
32
32
|
'Staged spike with golden fixtures per WORKFLOW §14. Discovery + fixture + pipeline-with-gates + two-layer evaluation, when the *technique* is uncertain across multiple plausible approaches.',
|
|
33
|
+
'agentic-tdg':
|
|
34
|
+
'Outcome-based prompting per WORKFLOW §9. Ground truth pair + Test Dependency Map + three approaches + single-criterion selection, when the technique is known but the implementation strategy is uncertain.',
|
|
33
35
|
'agentic-design': 'Bootstrap `DESIGN.md` from existing tokens (frontend projects).',
|
|
34
36
|
'agentic-subagent': 'Draft a new Claude Code subagent at `.claude/agents/<name>.md`.',
|
|
35
37
|
'agentic-skill': 'Draft a new Claude Code or Codex skill at the appropriate path.',
|
|
@@ -165,6 +165,6 @@ A single `AGENTS.md` at the repo root, ≤150 lines, every line operational. No
|
|
|
165
165
|
## Next
|
|
166
166
|
|
|
167
167
|
- In `team` / `mature`: run `/agentic-architecture` once load-bearing patterns emerge in the code.
|
|
168
|
-
- When you start your first feature: `/agentic-spec` (Layer
|
|
168
|
+
- When you start your first feature: `/agentic-spec` (Layer 3 of the five-layer artifact stack).
|
|
169
169
|
- Skip both above in `poc` / `solo` until the project genuinely needs them — the WORKFLOW §1 prune principle applies.
|
|
170
170
|
- `agentic-philosophy` auto-loads on non-trivial work; no explicit invocation needed.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentic-next
|
|
3
|
-
description: Survey the project's state across the
|
|
3
|
+
description: Survey the project's state across the five-layer artifact stack and recommend prioritized next actions, modeled on `flutter doctor`. Use when the user asks "what's next", "next step", "where am I", "project status", "doctor", "what should I do", "audit my workflow", or whenever a navigation aid is needed mid-flow. Read-only; complements `agentic-audit` (drift detection, a different question). Profile-aware — `poc` suppresses Layer 3 / 4 noise, `team` / `mature` run the full survey.
|
|
4
4
|
allowed-tools: Read, Glob, Grep, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ Do not parse skill bodies. Do not run tests. Do not invoke other skills. The sur
|
|
|
23
23
|
|
|
24
24
|
## Step 1 — Layer-by-layer status
|
|
25
25
|
|
|
26
|
-
Render
|
|
26
|
+
Render five sections in this exact order. For each section, list what is present, what is in flight, what is missing or stale. Use words for status (`present`, `in flight`, `missing`, `stale`) — no emoji.
|
|
27
27
|
|
|
28
28
|
**Layer 1 — Constitution.**
|
|
29
29
|
- `AGENTS.md` (or `CLAUDE.md`) present?
|
|
@@ -31,7 +31,11 @@ Render four sections in this exact order. For each section, list what is present
|
|
|
31
31
|
- `ARCHITECTURE.md` present?
|
|
32
32
|
- `DESIGN.md` present? (frontend projects only)
|
|
33
33
|
|
|
34
|
-
**Layer 2 —
|
|
34
|
+
**Layer 2 — Domain (`CONTEXT.md`).**
|
|
35
|
+
- `CONTEXT.md` present at repo root, *or* `CONTEXT-MAP.md` plus per-context `CONTEXT.md` files for multi-context repos? (Lazy-created per [ADR-0019](../adr/0019-domain-language-layer.md) — `missing` is a valid state for projects whose first domain term has not been resolved yet, not a finding to flag in `poc` / `solo`.)
|
|
36
|
+
- For each present `CONTEXT.md`, report whether the Language section has at least one term with an `_Avoid_:` line — empty glossary is worse than no glossary.
|
|
37
|
+
|
|
38
|
+
**Layer 3 — Specs (`doc/specs/`).**
|
|
35
39
|
|
|
36
40
|
For each spec file, report `Status` and the count of tasks whose `Spec ref` field points at it:
|
|
37
41
|
|
|
@@ -42,13 +46,13 @@ For each spec file, report `Status` and the count of tasks whose `Spec ref` fiel
|
|
|
42
46
|
|
|
43
47
|
Flag specs with `Status: accepted` and zero implementing tasks — that is the most common stuck state.
|
|
44
48
|
|
|
45
|
-
**Layer
|
|
49
|
+
**Layer 4 — Plans / Decisions.**
|
|
46
50
|
|
|
47
51
|
`doc/adr/` — count by status: `proposed`, `accepted`, `deprecated`, `superseded`. Flag any `proposed` ADRs explicitly with their slug — they need a decision.
|
|
48
52
|
|
|
49
53
|
`doc/tasks/` — count by status: `proposed`, `in-progress`, `blocked`, `done`. List in-progress and blocked tasks with their slugs and `Spec ref`. Flag tasks with no `Spec ref` and no `Board ref` as orphans (no clear scope tie).
|
|
50
54
|
|
|
51
|
-
**Layer
|
|
55
|
+
**Layer 5 — Code.**
|
|
52
56
|
- Branch: `<name>` (`<n>` commits ahead of `main` if applicable).
|
|
53
57
|
- Tests: wired? (presence of `npm test` script / `pytest` / `cargo test` / `go test ./...`).
|
|
54
58
|
- Hooks: wired? (presence of `.husky/`, `lefthook.yml`, `.pre-commit-config.yaml`, or active `.git/hooks/` scripts).
|
|
@@ -81,8 +85,8 @@ If nothing actionable surfaces, say so explicitly — empty output is real signa
|
|
|
81
85
|
|
|
82
86
|
Apply per-profile rules at the end so the user sees output matched to their maturity:
|
|
83
87
|
|
|
84
|
-
- **`poc`:** suppress Layer
|
|
85
|
-
- **`solo`:** Layer
|
|
88
|
+
- **`poc`:** suppress Layer 3 (specs) and Layer 4 (ADRs / tasks) sections entirely if those directories do not exist. Show Layer 1 + Layer 2 + Layer 5 only. Layer 2 (Domain) renders informationally — `CONTEXT.md` missing is *not* a finding at `poc` (the file is lazy-created when the first term is resolved). Recommendation set: `/agentic-ground` for research, `/agentic-audit` for drift, `/agentic-update` for staleness.
|
|
89
|
+
- **`solo`:** Layer 3 / Layer 4 render but ADR / `ARCHITECTURE.md` absence is informational — no "needs action" flag. Specs are universal at this profile; spec-without-tasks remains a real finding. Layer 2 — same lazy-creation rule as `poc`.
|
|
86
90
|
- **`team`:** full survey. Default profile.
|
|
87
91
|
- **`mature`:** additionally flag hooks-not-wired louder ("WORKFLOW §11 binding for `mature` profile — `/agentic-hooks` recommended").
|
|
88
92
|
|
|
@@ -99,13 +103,16 @@ A single Markdown message structured as:
|
|
|
99
103
|
### Layer 1 — Constitution
|
|
100
104
|
<one-line status per artifact>
|
|
101
105
|
|
|
102
|
-
### Layer 2 —
|
|
106
|
+
### Layer 2 — Domain (CONTEXT.md)
|
|
107
|
+
<present / lazy-missing per ADR-0019; glossary-empty flag if file exists but has no terms>
|
|
108
|
+
|
|
109
|
+
### Layer 3 — Specs (doc/specs/)
|
|
103
110
|
<spec list with status + task count, or "no specs">
|
|
104
111
|
|
|
105
|
-
### Layer
|
|
112
|
+
### Layer 4 — Plans / Decisions
|
|
106
113
|
<ADR + task summaries with explicit flags>
|
|
107
114
|
|
|
108
|
-
### Layer
|
|
115
|
+
### Layer 5 — Code
|
|
109
116
|
<branch / tests / hooks / CI status>
|
|
110
117
|
|
|
111
118
|
### Recommended next (priority)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentic-spec
|
|
3
|
-
description: Draft a feature-level specification at doc/specs/NNNN-<slug>.md following the kit's
|
|
3
|
+
description: Draft a feature-level specification at doc/specs/NNNN-<slug>.md following the kit's five-layer artifact stack (Constitution → Domain → Spec → Plan/Decisions → Code). Adapts GitHub Spec Kit's mandatory sections (User Scenarios, Requirements, Success Criteria) to the kit's documentation discipline. Use when the user wants to write, draft, scaffold, or open a feature spec, PRD, product requirements, feature brief, user stories, or success criteria for a feature multiple tasks will implement. Status starts at draft; the file is the binding feature contract once accepted.
|
|
4
4
|
allowed-tools: Read, Write, Glob, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /agentic-spec
|
|
8
8
|
|
|
9
|
-
Drafts `doc/specs/<NNNN>-<short-slug>.md` for one feature. Status lifecycle: `draft` → `accepted` → `shipped` | `superseded by SPEC-NNNN`. Spec is the layer-
|
|
9
|
+
Drafts `doc/specs/<NNNN>-<short-slug>.md` for one feature. Status lifecycle: `draft` → `accepted` → `shipped` | `superseded by SPEC-NNNN`. Spec is the layer-3 artifact in the kit's five-layer stack — Constitution (`AGENTS.md` + `WORKFLOW.md`) → Domain (`CONTEXT.md`) → **Spec (this skill)** → Plan/Decisions (`ARCHITECTURE.md` + `doc/adr/` + `doc/tasks/`) → Code. Multiple tasks implement one spec; ADRs may be driven by spec constraints. The Domain layer (`CONTEXT.md`, ubiquitous language per Evans 2003) is the source of canonical nouns the spec must use; if the spec introduces a new noun, resolve it through `CONTEXT.md` first.
|
|
10
10
|
|
|
11
11
|
## Step 1 — Determine NNNN and slug
|
|
12
12
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-tdg
|
|
3
|
+
description: Outcome-based prompting per WORKFLOW.md §9. Give the agent the finish line first, not the path. Five steps — confirm regime, ground truth pair, Test Dependency Map, three approaches, pick by one criterion, implement and verify. Triggers on "outcome-based", "TDG", "ground truth", "expected output", "three approaches", "pick by criterion", "test dependency map", "TDM", "before modifying", "tests covering this file", "give the finish line". Routes to `agentic-spike` if the technique itself is uncertain. No file written; output is the verified implementation that lands through normal commits.
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /agentic-tdg
|
|
8
|
+
|
|
9
|
+
Implements WORKFLOW.md §9 (Outcome-Based Prompting / Test Dependency Map) end-to-end. Process scaffold for the implementation phase when the canonical technique is known and multiple implementation strategies are plausible. No file written — output is the verified implementation that lands through normal commits; ground-truth pair, candidate set, and selection criterion go into the commit message body or task `Notes`.
|
|
10
|
+
|
|
11
|
+
## Step 0 — Confirm regime
|
|
12
|
+
|
|
13
|
+
TDG is for the *technique-known, implementation-strategy-uncertain* regime. Run the skill only when:
|
|
14
|
+
|
|
15
|
+
* The canonical approach is settled (via `agentic-ground` or prior knowledge), AND
|
|
16
|
+
* Multiple implementation strategies could produce the expected output with different trade-offs along readability / performance / testability axes.
|
|
17
|
+
|
|
18
|
+
Route elsewhere when:
|
|
19
|
+
|
|
20
|
+
* The *technique itself* is uncertain across multiple plausible approaches → `/agentic-spike` (WORKFLOW §14). Spike validates technique with golden fixture + per-stage debug; TDG validates implementation with ground-truth pair + TDM.
|
|
21
|
+
* The path is fully obvious (one-line fix, mechanical refactor, byte-for-byte port) → TDG is overkill; proceed directly without the skill.
|
|
22
|
+
* No tests cover the surface and the project does not yet have a test runner wired → consider `/agentic-hooks` for project gates first; TDG depends on a verifiable green baseline.
|
|
23
|
+
|
|
24
|
+
## Step 1 — Ground truth pair
|
|
25
|
+
|
|
26
|
+
State raw input + exact expected output before any code is written. Concrete, not aspirational. The pair is the contract the implementation must satisfy.
|
|
27
|
+
|
|
28
|
+
Format depends on the surface:
|
|
29
|
+
|
|
30
|
+
* For pure functions: input arguments + expected return value, as code-block or JSON.
|
|
31
|
+
* For data transformations: source data + transformed data, side-by-side.
|
|
32
|
+
* For CLI / API surfaces: request payload + response payload, as paste-ready examples.
|
|
33
|
+
* For UI changes: pre-state DOM / screenshot + post-state DOM / screenshot.
|
|
34
|
+
|
|
35
|
+
Example (pure function):
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Input: parse('--agent claude-code --yes')
|
|
39
|
+
Expected output: { agent: 'claude-code', yes: true, dryRun: false, force: false }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The pair is small, explicit, and verifiable. Aspirational language ("loads fast", "handles all edge cases") is not ground truth — concrete examples are.
|
|
43
|
+
|
|
44
|
+
## Step 2 — Test Dependency Map (TDM)
|
|
45
|
+
|
|
46
|
+
List the tests covering the file(s) the change will touch. Run them to establish the green baseline. If no tests cover the surface, write one first that exercises the *current* behavior before any modification.
|
|
47
|
+
|
|
48
|
+
Process:
|
|
49
|
+
|
|
50
|
+
1. Grep for tests referencing the file by import path: `grep -r 'from.*<file>' test/ tests/`.
|
|
51
|
+
2. Grep for tests referencing the function or symbol: `grep -r '<symbol>' test/ tests/`.
|
|
52
|
+
3. Run the matched tests in isolation to confirm green: `npx node --test test/<matched>.test.js` or equivalent for the language.
|
|
53
|
+
4. If empty: write a test that asserts the current behavior. Run. Confirm green. *Then* proceed to Step 3.
|
|
54
|
+
|
|
55
|
+
The TDM is the verification surface — Step 5's "implement + verify" loop runs these tests, not the full suite, so the feedback loop stays under a few seconds. Full-suite runs happen at commit-time via the project's pre-push hook (`agentic-hooks`).
|
|
56
|
+
|
|
57
|
+
## Step 3 — Three approaches
|
|
58
|
+
|
|
59
|
+
Generate three implementation candidates that produce the ground-truth pair. Each candidate names trade-offs along the §9 axes:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Approach A: <name / one-line description>
|
|
63
|
+
- readability: <high / medium / low + reason>
|
|
64
|
+
- performance: <O(...), bytes allocated, etc.>
|
|
65
|
+
- testability: <surface area, mockability, isolation>
|
|
66
|
+
|
|
67
|
+
Approach B: <name / one-line description>
|
|
68
|
+
- readability: ...
|
|
69
|
+
- performance: ...
|
|
70
|
+
- testability: ...
|
|
71
|
+
|
|
72
|
+
Approach C: <name / one-line description>
|
|
73
|
+
- readability: ...
|
|
74
|
+
- performance: ...
|
|
75
|
+
- testability: ...
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
No premature optimization across all three axes — each candidate names its trade-offs honestly. A candidate that is "high on every axis" is suspect; surface what it actually trades against.
|
|
79
|
+
|
|
80
|
+
Three is a soft target. If the surface is small and only two approaches are plausible, two is fine. If the third candidate is contrived to fill a slot, drop it; the criterion-based selection in Step 4 handles two as easily as three.
|
|
81
|
+
|
|
82
|
+
## Step 4 — Pick by one criterion
|
|
83
|
+
|
|
84
|
+
The user names the criterion explicitly — readability *or* performance *or* testability, **not all three at once**. The skill commits to the selected candidate. Alternatives get one-line rejection notes for the commit message body or task `Notes`:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Criterion: testability
|
|
88
|
+
Picked: Approach B (smaller mock surface, no global state read)
|
|
89
|
+
Rejected:
|
|
90
|
+
- Approach A — one fewer allocation but mocks four singletons (testability lower)
|
|
91
|
+
- Approach C — clearer at the call site but writes shared state (testability lower)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The discipline: refuse "optimize for readability AND performance AND testability". Tradeoffs are real — naming the criterion makes them visible.
|
|
95
|
+
|
|
96
|
+
When the host exposes `AskUserQuestion` (per ADR-0014), render the three candidates as a structured multi-choice card with the criterion as the framing question.
|
|
97
|
+
|
|
98
|
+
## Step 5 — Implement + verify
|
|
99
|
+
|
|
100
|
+
Modify the file. Run the TDM tests from Step 2. If green, the change is done — proceed to commit with the ground-truth pair + criterion + rejection notes in the commit message body. If red, iterate against the same ground-truth pair until green.
|
|
101
|
+
|
|
102
|
+
Verification rules:
|
|
103
|
+
|
|
104
|
+
* Do **not** edit the TDM tests to make them green. The tests are the verification surface; modifying them while implementing is the hidden form of "almost right" that WORKFLOW §12 names. If a test is wrong, fix the test first as a separate diff with its own ground-truth pair.
|
|
105
|
+
* Do **not** declare done before the TDM tests pass. Type-check passing is not the gate; the test gate is.
|
|
106
|
+
* If iteration loops past three attempts and the implementation still fails, **stop and re-examine the ground-truth pair**. The pair may be ambiguous, or the canonical approach may not actually map to the expected output. Routing back to `agentic-ground` (re-research) or `agentic-spike` (technique uncertain) is preferable to forcing a wrong implementation through.
|
|
107
|
+
|
|
108
|
+
## Output contract
|
|
109
|
+
|
|
110
|
+
No file written. Output is structured conversation:
|
|
111
|
+
|
|
112
|
+
1. Confirmation of regime (Step 0 — TDG or routed elsewhere).
|
|
113
|
+
2. Ground-truth pair (Step 1).
|
|
114
|
+
3. TDM list with green-baseline confirmation (Step 2).
|
|
115
|
+
4. Three candidates with trade-off table (Step 3).
|
|
116
|
+
5. Selection by criterion + rejection notes (Step 4).
|
|
117
|
+
6. Implementation + verification result (Step 5).
|
|
118
|
+
|
|
119
|
+
When the change is committed, the ground-truth pair, criterion, and rejection notes go into the commit message body. When a task file exists, the same content also lands in the task's `Notes` log under a dated entry.
|
|
120
|
+
|
|
121
|
+
## Next
|
|
122
|
+
|
|
123
|
+
- After Step 5 verification passes: commit the change with the ground-truth pair + criterion + rejection notes in the body.
|
|
124
|
+
- `/agentic-review main..HEAD` (or current scope) before merge — WORKFLOW §10. The TDM tests verify the implementation matches ground truth; §10 review checks coupling, edge cases, spec drift the pair did not cover.
|
|
125
|
+
- If the work spans multiple sessions: `/agentic-task` for explicit decomposition (Spec ref the original spec; cite this TDG run in the task `Notes`).
|
|
126
|
+
- If iteration stalled at Step 5 and routing back was needed: `/agentic-ground` (re-research) or `/agentic-spike` (technique uncertain).
|
|
@@ -147,6 +147,6 @@ A single `AGENTS.md` at the repo root, ≤150 lines, every line operational. No
|
|
|
147
147
|
## Next
|
|
148
148
|
|
|
149
149
|
- In `team` / `mature`: run `/agentic-architecture` once load-bearing patterns emerge in the code.
|
|
150
|
-
- When you start your first feature: `/agentic-spec` (Layer
|
|
150
|
+
- When you start your first feature: `/agentic-spec` (Layer 3 of the five-layer artifact stack).
|
|
151
151
|
- Skip both above in `poc` / `solo` until the project genuinely needs them — the WORKFLOW §1 prune principle applies.
|
|
152
152
|
- `agentic-philosophy` auto-loads on non-trivial work.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentic-next
|
|
3
|
-
description: Survey the project's state across the
|
|
3
|
+
description: Survey the project's state across the five-layer artifact stack and recommend prioritized next actions, modeled on `flutter doctor`. Use when the user asks "what's next", "next step", "where am I", "project status", "doctor", "what should I do", "audit my workflow". Read-only; complements `agentic-audit` (drift detection, a different question). Profile-aware — `poc` suppresses Layer 3/4 noise, `team`/`mature` run the full survey.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<background_information>
|
|
@@ -20,15 +20,17 @@ Step 0 — read state. Detect baseline:
|
|
|
20
20
|
|
|
21
21
|
Do not parse skill bodies. Do not run tests. Do not invoke other skills.
|
|
22
22
|
|
|
23
|
-
Step 1 — layer-by-layer status. Render
|
|
23
|
+
Step 1 — layer-by-layer status. Render five sections in this exact order. Use words for status (`present`, `in flight`, `missing`, `stale`) — no emoji.
|
|
24
24
|
|
|
25
25
|
Layer 1 — Constitution: AGENTS.md / CLAUDE.md, WORKFLOW.md, ARCHITECTURE.md, DESIGN.md (frontend only).
|
|
26
26
|
|
|
27
|
-
Layer 2 —
|
|
27
|
+
Layer 2 — Domain (CONTEXT.md): present at repo root, *or* CONTEXT-MAP.md plus per-context CONTEXT.md files? Lazy-created per ADR-0019 — `missing` is valid for projects whose first domain term has not been resolved yet, not a finding to flag in poc / solo. For each present file, flag empty-glossary (Language section with zero terms).
|
|
28
28
|
|
|
29
|
-
Layer 3 —
|
|
29
|
+
Layer 3 — Specs (doc/specs/): for each file, report Status + count of tasks whose Spec ref points at it. Flag specs with Status: accepted and zero implementing tasks.
|
|
30
30
|
|
|
31
|
-
Layer 4 —
|
|
31
|
+
Layer 4 — Plans / Decisions: doc/adr/ counts by status, flag proposed ADRs with their slug. doc/tasks/ counts by status, list in-progress + blocked with slug and Spec ref. Flag tasks with no Spec ref and no Board ref as orphans.
|
|
32
|
+
|
|
33
|
+
Layer 5 — Code: branch + ahead count, tests wired? (npm test / pytest / cargo test / go test), hooks wired? (.husky / lefthook.yml / .pre-commit-config.yaml / .git/hooks/), CI wired? (.github/workflows / .gitlab-ci.yml / .circleci/).
|
|
32
34
|
|
|
33
35
|
Step 2 — cross-cut signals:
|
|
34
36
|
- Pending fresh-context review: branch ≥1 commits ahead of main with no .agentic/reviews/<ts>-*.md for the current range → recommend agentic-review.
|
|
@@ -48,8 +50,8 @@ Priority heuristic:
|
|
|
48
50
|
If nothing actionable surfaces, say so: "No urgent next action. Continue current work or invoke `/agentic-audit` for a full drift check."
|
|
49
51
|
|
|
50
52
|
Step 4 — profile-aware filtering. Apply at the end:
|
|
51
|
-
- poc: suppress Layer
|
|
52
|
-
- solo: Layer
|
|
53
|
+
- poc: suppress Layer 3/4 sections if those directories do not exist. Show Layer 1 + Layer 2 + Layer 5 only. Layer 2 (Domain) renders informationally — CONTEXT.md missing is *not* a finding (lazy-created). Recommendation set: `/agentic-ground`, `/agentic-audit`, `agentic update`.
|
|
54
|
+
- solo: Layer 3/4 render; ADR / ARCHITECTURE.md absence is informational, not a flag. Specs are universal; spec-without-tasks remains a real finding. Layer 2 — same lazy-creation rule as poc.
|
|
53
55
|
- team: full survey (default).
|
|
54
56
|
- mature: additionally flag hooks-not-wired louder (WORKFLOW §11 binding for mature profile).
|
|
55
57
|
</instructions>
|
|
@@ -66,13 +68,16 @@ A single Markdown message structured as:
|
|
|
66
68
|
### Layer 1 — Constitution
|
|
67
69
|
<one-line status per artifact>
|
|
68
70
|
|
|
69
|
-
### Layer 2 —
|
|
71
|
+
### Layer 2 — Domain (CONTEXT.md)
|
|
72
|
+
<present / lazy-missing per ADR-0019; glossary-empty flag if file exists but has no terms>
|
|
73
|
+
|
|
74
|
+
### Layer 3 — Specs (doc/specs/)
|
|
70
75
|
<spec list with status + task count, or "no specs">
|
|
71
76
|
|
|
72
|
-
### Layer
|
|
77
|
+
### Layer 4 — Plans / Decisions
|
|
73
78
|
<ADR + task summaries with explicit flags>
|
|
74
79
|
|
|
75
|
-
### Layer
|
|
80
|
+
### Layer 5 — Code
|
|
76
81
|
<branch / tests / hooks / CI status>
|
|
77
82
|
|
|
78
83
|
### Recommended next (priority)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: agentic-next
|
|
3
|
-
short_description: State-aware navigation aid (flutter doctor pattern). Surveys
|
|
3
|
+
short_description: State-aware navigation aid (flutter doctor pattern). Surveys five-layer artifact stack + recommends prioritized next actions. Read-only.
|
|
4
4
|
policy:
|
|
5
5
|
allow_implicit_invocation: false
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentic-spec
|
|
3
|
-
description: Draft a feature-level specification at doc/specs/NNNN-<slug>.md following the
|
|
3
|
+
description: Draft a feature-level specification at doc/specs/NNNN-<slug>.md following the five-layer artifact stack (Constitution → Domain → Spec → Plan/Decisions → Code). Adapts GitHub Spec Kit's mandatory sections (User Scenarios, Requirements, Success Criteria) to the kit's documentation discipline. Use when the user wants to write, draft, scaffold, or open a feature spec, PRD, product requirements, feature brief, user stories, or success criteria. Status starts at draft.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<background_information>
|
|
7
|
-
Drafts `doc/specs/<NNNN>-<short-slug>.md` for one feature. Status lifecycle: draft → accepted → shipped | superseded by SPEC-NNNN. Spec is the layer-
|
|
7
|
+
Drafts `doc/specs/<NNNN>-<short-slug>.md` for one feature. Status lifecycle: draft → accepted → shipped | superseded by SPEC-NNNN. Spec is the layer-3 artifact in the kit's five-layer stack — Constitution (`AGENTS.md` + `WORKFLOW.md`) → Domain (`CONTEXT.md`) → Spec (this skill) → Plan/Decisions (`ARCHITECTURE.md` + `doc/adr/` + `doc/tasks/`) → Code. Multiple tasks implement one spec; ADRs may be driven by spec constraints. The Domain layer (ubiquitous language per Evans 2003) is the source of canonical nouns the spec must use; if the spec introduces a new noun, resolve it through `CONTEXT.md` first.
|
|
8
8
|
|
|
9
9
|
Codex auto-trigger on description keywords is less mature than Claude Code's. If auto-invocation does not fire when the user asks to "draft a spec" or "write a PRD" on a non-trivial feature, invoke this skill manually.
|
|
10
10
|
</background_information>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-tdg
|
|
3
|
+
description: Outcome-based prompting per WORKFLOW.md §9. Give the agent the finish line first, not the path. Five steps — confirm regime, ground truth pair, Test Dependency Map, three approaches, pick by one criterion, implement and verify. Triggers on "outcome-based", "TDG", "ground truth", "expected output", "three approaches", "pick by criterion", "test dependency map", "TDM", "before modifying", "tests covering this file", "give the finish line". Routes to `agentic-spike` if the technique itself is uncertain. No file written; output is the verified implementation that lands through normal commits.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<background_information>
|
|
7
|
+
Implements WORKFLOW.md §9 (Outcome-Based Prompting / Test Dependency Map) end-to-end. The skill is for the implementation phase when the canonical technique is known and multiple implementation strategies are plausible. WORKFLOW §14 (`agentic-spike`) covers the technique-unknown regime; §9 (this skill) covers the implementation-strategy-uncertain regime.
|
|
8
|
+
|
|
9
|
+
No file is written. The output of the skill is the verified implementation that lands in the repo through normal commits. The ground-truth pair, candidate set, selection criterion, and TDM list go into the commit message body — or the task's `Notes` log when one exists — not into a separate `doc/` artifact.
|
|
10
|
+
|
|
11
|
+
Codex auto-trigger on description keywords is less mature than Claude Code's. If auto-invocation does not fire when the user mentions outcome-based prompting, ground truth, three approaches, or a Test Dependency Map, invoke this skill manually.
|
|
12
|
+
</background_information>
|
|
13
|
+
|
|
14
|
+
<instructions>
|
|
15
|
+
Step 0 — confirm regime. TDG is for the *technique-known, implementation-strategy-uncertain* regime. Run the skill only when the canonical approach is settled (via `agentic-ground` or prior knowledge) AND multiple implementation strategies could produce the expected output with different trade-offs along readability / performance / testability axes.
|
|
16
|
+
|
|
17
|
+
Route elsewhere when:
|
|
18
|
+
- The *technique itself* is uncertain across multiple plausible approaches → `agentic-spike` (WORKFLOW §14). Spike validates technique with golden fixture + per-stage debug; TDG validates implementation with ground-truth pair + TDM.
|
|
19
|
+
- The path is fully obvious (one-line fix, mechanical refactor, byte-for-byte port) → TDG is overkill; proceed directly without the skill.
|
|
20
|
+
- No tests cover the surface and the project does not yet have a test runner wired → consider `agentic-hooks` for project gates first; TDG depends on a verifiable green baseline.
|
|
21
|
+
|
|
22
|
+
Step 1 — ground truth pair. State raw input + exact expected output before any code is written. Concrete, not aspirational. The pair is the contract the implementation must satisfy.
|
|
23
|
+
|
|
24
|
+
Format depends on the surface:
|
|
25
|
+
- For pure functions: input arguments + expected return value, as code-block or JSON.
|
|
26
|
+
- For data transformations: source data + transformed data, side-by-side.
|
|
27
|
+
- For CLI / API surfaces: request payload + response payload, as paste-ready examples.
|
|
28
|
+
- For UI changes: pre-state DOM / screenshot + post-state DOM / screenshot.
|
|
29
|
+
|
|
30
|
+
Example (pure function):
|
|
31
|
+
```
|
|
32
|
+
Input: parse('--agent claude-code --yes')
|
|
33
|
+
Expected output: { agent: 'claude-code', yes: true, dryRun: false, force: false }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The pair is small, explicit, and verifiable. Aspirational language ("loads fast", "handles all edge cases") is not ground truth — concrete examples are.
|
|
37
|
+
|
|
38
|
+
Step 2 — Test Dependency Map (TDM). List the tests covering the file(s) the change will touch. Run them to establish the green baseline. If no tests cover the surface, write one first that exercises the *current* behavior before any modification.
|
|
39
|
+
|
|
40
|
+
Process:
|
|
41
|
+
1. Grep for tests referencing the file by import path: `grep -r 'from.*<file>' test/ tests/`.
|
|
42
|
+
2. Grep for tests referencing the function or symbol: `grep -r '<symbol>' test/ tests/`.
|
|
43
|
+
3. Run the matched tests in isolation to confirm green: `npx node --test test/<matched>.test.js` or equivalent for the language.
|
|
44
|
+
4. If empty: write a test that asserts the current behavior. Run. Confirm green. *Then* proceed to Step 3.
|
|
45
|
+
|
|
46
|
+
The TDM is the verification surface — Step 5's "implement + verify" loop runs these tests, not the full suite, so the feedback loop stays under a few seconds. Full-suite runs happen at commit-time via the project's pre-push hook (`agentic-hooks`).
|
|
47
|
+
|
|
48
|
+
Step 3 — three approaches. Generate three implementation candidates that produce the ground-truth pair. Each candidate names trade-offs along the §9 axes:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Approach A: <name / one-line description>
|
|
52
|
+
- readability: <high / medium / low + reason>
|
|
53
|
+
- performance: <O(...), bytes allocated, etc.>
|
|
54
|
+
- testability: <surface area, mockability, isolation>
|
|
55
|
+
|
|
56
|
+
Approach B: <name / one-line description>
|
|
57
|
+
- readability: ...
|
|
58
|
+
- performance: ...
|
|
59
|
+
- testability: ...
|
|
60
|
+
|
|
61
|
+
Approach C: <name / one-line description>
|
|
62
|
+
- readability: ...
|
|
63
|
+
- performance: ...
|
|
64
|
+
- testability: ...
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
No premature optimization across all three axes — each candidate names its trade-offs honestly. A candidate that is "high on every axis" is suspect; surface what it actually trades against.
|
|
68
|
+
|
|
69
|
+
Three is a soft target. If the surface is small and only two approaches are plausible, two is fine. If the third candidate is contrived to fill a slot, drop it; the criterion-based selection in Step 4 handles two as easily as three.
|
|
70
|
+
|
|
71
|
+
Step 4 — pick by one criterion. The user names the criterion explicitly — readability *or* performance *or* testability, **not all three at once**. The skill commits to the selected candidate. Alternatives get one-line rejection notes for the commit message body or task `Notes`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Criterion: testability
|
|
75
|
+
Picked: Approach B (smaller mock surface, no global state read)
|
|
76
|
+
Rejected:
|
|
77
|
+
- Approach A — one fewer allocation but mocks four singletons (testability lower)
|
|
78
|
+
- Approach C — clearer at the call site but writes shared state (testability lower)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The discipline: refuse "optimize for readability AND performance AND testability". Tradeoffs are real — naming the criterion makes them visible.
|
|
82
|
+
|
|
83
|
+
Step 5 — implement + verify. Modify the file. Run the TDM tests from Step 2. If green, the change is done — proceed to commit with the ground-truth pair + criterion + rejection notes in the commit message body. If red, iterate against the same ground-truth pair until green.
|
|
84
|
+
|
|
85
|
+
Verification rules:
|
|
86
|
+
- Do **not** edit the TDM tests to make them green. The tests are the verification surface; modifying them while implementing is the hidden form of "almost right" that WORKFLOW §12 names. If a test is wrong, fix the test first as a separate diff with its own ground-truth pair.
|
|
87
|
+
- Do **not** declare done before the TDM tests pass. Type-check passing is not the gate; the test gate is.
|
|
88
|
+
- If iteration loops past three attempts and the implementation still fails, **stop and re-examine the ground-truth pair**. The pair may be ambiguous, or the canonical approach may not actually map to the expected output. Routing back to `agentic-ground` (re-research) or `agentic-spike` (technique uncertain) is preferable to forcing a wrong implementation through.
|
|
89
|
+
</instructions>
|
|
90
|
+
|
|
91
|
+
<output_contract>
|
|
92
|
+
No file written. Output is structured conversation:
|
|
93
|
+
|
|
94
|
+
1. Confirmation of regime (Step 0 — TDG or routed elsewhere).
|
|
95
|
+
2. Ground-truth pair (Step 1).
|
|
96
|
+
3. TDM list with green-baseline confirmation (Step 2).
|
|
97
|
+
4. Three candidates with trade-off table (Step 3).
|
|
98
|
+
5. Selection by criterion + rejection notes (Step 4).
|
|
99
|
+
6. Implementation + verification result (Step 5).
|
|
100
|
+
|
|
101
|
+
When the change is committed, the ground-truth pair, criterion, and rejection notes go into the commit message body. When a task file exists, the same content also lands in the task's `Notes` log under a dated entry.
|
|
102
|
+
</output_contract>
|
|
103
|
+
|
|
104
|
+
## Next
|
|
105
|
+
|
|
106
|
+
- After Step 5 verification passes: commit the change with the ground-truth pair + criterion + rejection notes in the body.
|
|
107
|
+
- `/agentic-review main..HEAD` (or current scope) before merge — WORKFLOW §10. The TDM tests verify the implementation matches ground truth; §10 review checks coupling, edge cases, spec drift the pair did not cover.
|
|
108
|
+
- If the work spans multiple sessions: `/agentic-task` for explicit decomposition (Spec ref the original spec; cite this TDG run in the task `Notes`).
|
|
109
|
+
- If iteration stalled at Step 5 and routing back was needed: `/agentic-ground` (re-research) or `/agentic-spike` (technique uncertain).
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: agentic-tdg
|
|
3
|
+
short_description: Outcome-based prompting per WORKFLOW §9. Ground truth pair + Test Dependency Map + three approaches + single-criterion selection. For implementation-strategy uncertainty when the technique is known; routes to agentic-spike if the technique itself is uncertain.
|
|
4
|
+
policy:
|
|
5
|
+
allow_implicit_invocation: false
|