@alexandrealvaro/agentic 0.12.0-beta.1 → 0.13.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 CHANGED
@@ -41,6 +41,7 @@ Two categories ([ADR-0007](doc/adr/0007-workflow-operational-skills.md)) and two
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
42
  | `agentic-next` | workflow-operational | universal | State-aware navigation aid (`flutter doctor` pattern) — surveys the four-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` |
@@ -158,6 +159,8 @@ The kit's discipline scales with the project's maturity. A solo PoC may legitima
158
159
 
159
160
  **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
161
 
162
+ **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.
163
+
161
164
  ## Manual prompts
162
165
 
163
166
  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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandrealvaro/agentic",
3
- "version": "0.12.0-beta.1",
3
+ "version": "0.13.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": {
@@ -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']
@@ -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',
@@ -30,6 +30,8 @@ export const SKILL_DESCRIPTIONS = {
30
30
  'State survey + prioritized next-action recommendations across the four-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.',
@@ -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).
@@ -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