@alexandrealvaro/agentic 0.3.0-beta.2 → 0.5.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 +7 -1
- package/WORKFLOW.md +18 -5
- package/package.json +1 -1
- package/src/commands/init.js +4 -0
- package/src/lib/rootdoc.js +4 -0
- package/src/skills/claude-code/agentic-ground/SKILL.md +100 -0
- package/src/skills/claude-code/agentic-spec/SKILL.md +125 -0
- package/src/skills/claude-code/agentic-task/SKILL.md +3 -1
- package/src/skills/codex/agentic-ground/SKILL.md +82 -0
- package/src/skills/codex/agentic-ground/agents/openai.yaml +5 -0
- package/src/skills/codex/agentic-spec/SKILL.md +105 -0
- package/src/skills/codex/agentic-spec/agents/openai.yaml +5 -0
- package/src/skills/codex/agentic-task/SKILL.md +3 -1
- package/templates/task.md +2 -1
package/README.md
CHANGED
|
@@ -31,10 +31,12 @@ Two categories ([ADR-0007](doc/adr/0007-workflow-operational-skills.md)) and two
|
|
|
31
31
|
| `agentic-bootstrap` | spec-driven | universal | Scans the repo, writes `AGENTS.md` ≤150 lines | `/agentic-bootstrap` |
|
|
32
32
|
| `agentic-architecture` | spec-driven | universal | Scans the code, writes `ARCHITECTURE.md` | `/agentic-architecture` |
|
|
33
33
|
| `agentic-adr` | spec-driven | universal | Drafts `doc/adr/NNNN-<slug>.md` from the conversation | `/agentic-adr` |
|
|
34
|
-
| `agentic-
|
|
34
|
+
| `agentic-spec` | spec-driven | universal | Drafts `doc/specs/NNNN-<slug>.md` — feature-level spec (User Scenarios, Requirements, Success Criteria) layer 2 of the four-layer stack | `/agentic-spec` |
|
|
35
|
+
| `agentic-task` | spec-driven | universal | Drafts `doc/tasks/NNNN-<slug>.md` (checkbox + Notes format; carries `Spec ref` to link the implementing spec) | `/agentic-task` |
|
|
35
36
|
| `agentic-audit` | spec-driven | universal | Read-only drift report (AGENTS.md / ARCHITECTURE.md / ADRs) | `/agentic-audit` |
|
|
36
37
|
| `agentic-philosophy` | workflow-operational | universal | Universal agent guardrails — auto-loads on non-trivial work | implicit |
|
|
37
38
|
| `agentic-review` | workflow-operational | universal | Fresh-context code review per WORKFLOW §10; structured findings, no "approve" | `/agentic-review <range>` |
|
|
39
|
+
| `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` |
|
|
38
40
|
| `agentic-design` | spec-driven | auto if frontend detected | Bootstrap `DESIGN.md` from existing tokens (Figma, tailwind.config, tokens.json, CSS custom props) | `/agentic-design` |
|
|
39
41
|
| `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` |
|
|
40
42
|
| `agentic-skill` | spec-driven | opt-in only | Drafts a new Claude Code or Codex skill at the appropriate path | `/agentic-skill` |
|
|
@@ -119,6 +121,10 @@ Prompts reference templates by relative path. Two ways to give your agent access
|
|
|
119
121
|
|
|
120
122
|
**Reviewing your own diff.** Run `/agentic-review <range>` (e.g. `/agentic-review main..HEAD` or `/agentic-review PR#42`). The skill assembles the diff, the relevant spec slice (`AGENTS.md`, applicable ADRs, the task's Acceptance Criteria), and delegates to a fresh-context reviewer subagent — no inherited bias from the session that wrote the code (WORKFLOW §10). Returns structured findings grouped Blocker / Concern / Note. Codex variant uses `/clear` + paste handoff since Codex has no subagent primitive.
|
|
121
123
|
|
|
124
|
+
**Researching before implementation.** Run `/agentic-ground` (or let it auto-trigger on non-trivial work). The skill runs a four-source levantamento — 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.
|
|
125
|
+
|
|
126
|
+
**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 2 of the four-layer artifact stack — Constitution → 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.
|
|
127
|
+
|
|
122
128
|
**Project already built with agents.** Treat missing artifacts as brownfield (run the relevant skill) and existing artifacts as audit (`/agentic-audit`).
|
|
123
129
|
|
|
124
130
|
## What ends up in your target project
|
package/WORKFLOW.md
CHANGED
|
@@ -30,15 +30,24 @@ What to keep in mind:
|
|
|
30
30
|
|
|
31
31
|
## 1. Spec-Driven Design
|
|
32
32
|
|
|
33
|
-
Define the rules before the agent writes a line. The temptation is to dump everything into `AGENTS.md` and hope it works — but bloat causes the model to ignore the file. Keep one topic per Markdown file: lean and focused.
|
|
33
|
+
Define the rules before the agent writes a line. The temptation is to dump everything into `AGENTS.md` and hope it works — but bloat causes the model to ignore the file. Keep one topic per Markdown file: lean and focused.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
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.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
### Four-layer artifact stack (purpose)
|
|
38
38
|
|
|
39
|
-
**
|
|
39
|
+
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.
|
|
40
|
+
2. **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).
|
|
41
|
+
3. **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.
|
|
42
|
+
4. **Code** — the implementation. Code is the primary documentation of behavior; comments justify non-obvious choices.
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
### Three context types (loading mechanism)
|
|
45
|
+
|
|
46
|
+
- **Operational context is advisory.** `AGENTS.md` (or `CLAUDE.md` for Claude Code, which can mirror or import the same content via `@AGENTS.md`) tells the agent how to build, test, follow conventions, and where the security boundaries are. The agent reads it as a guide, not a contract. Open standard `AGENTS.md` is native in most agentic IDEs.
|
|
47
|
+
- **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.
|
|
48
|
+
- **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.
|
|
49
|
+
|
|
50
|
+
Two rules apply across all of the above:
|
|
42
51
|
|
|
43
52
|
- **Acceptance criteria must be measurable.** "Build a dashboard" fails. "Loads in under 2 seconds, shows 6 months of history, passes axe accessibility" succeeds.
|
|
44
53
|
- **Prune.** If removing a line wouldn't make the agent fail, cut it.
|
|
@@ -89,6 +98,8 @@ Then check continuously, especially mid-implementation:
|
|
|
89
98
|
|
|
90
99
|
Sometimes you can't follow the happy path — that's fine. But always know where it is and why you left it.
|
|
91
100
|
|
|
101
|
+
The kit ships `agentic-ground` (workflow-operational skill) as the bound implementation of §4 + §5: it runs a four-source research pass (official docs, validated open-source examples, in-repo patterns, git history), synthesizes the happy path with citations, and gates any deviation behind an irrefutable justification before code is written.
|
|
102
|
+
|
|
92
103
|
## 5. Ground in Real Patterns
|
|
93
104
|
|
|
94
105
|
Don't dump the codebase into context. Anchor the model in a specific, project-relevant example.
|
|
@@ -97,6 +108,8 @@ Don't dump the codebase into context. Anchor the model in a specific, project-re
|
|
|
97
108
|
|
|
98
109
|
Cite specific files, not "the codebase." Use just-in-time retrieval: pass paths or IDs and let the agent fetch via tools when it needs to read them.
|
|
99
110
|
|
|
111
|
+
`agentic-ground` (see §4) is the workflow-operational skill that combines this with the other three research sources — official docs, validated OSS, and git history — into one indivisible pre-implementation pass.
|
|
112
|
+
|
|
100
113
|
## 6. Explore → Plan → Implement → Commit
|
|
101
114
|
|
|
102
115
|
For non-trivial changes, four phases:
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -48,9 +48,11 @@ export const REQUIRED_SKILLS = [
|
|
|
48
48
|
'agentic-philosophy',
|
|
49
49
|
'agentic-architecture',
|
|
50
50
|
'agentic-adr',
|
|
51
|
+
'agentic-spec',
|
|
51
52
|
'agentic-task',
|
|
52
53
|
'agentic-audit',
|
|
53
54
|
'agentic-review',
|
|
55
|
+
'agentic-ground',
|
|
54
56
|
];
|
|
55
57
|
|
|
56
58
|
/**
|
|
@@ -263,9 +265,11 @@ export async function initCommand(opts) {
|
|
|
263
265
|
'/agentic-bootstrap (AGENTS.md)',
|
|
264
266
|
'/agentic-architecture (ARCHITECTURE.md)',
|
|
265
267
|
'/agentic-adr',
|
|
268
|
+
'/agentic-spec (doc/specs/)',
|
|
266
269
|
'/agentic-task',
|
|
267
270
|
'/agentic-audit',
|
|
268
271
|
'/agentic-review (WORKFLOW §10)',
|
|
272
|
+
'/agentic-ground (WORKFLOW §4 + §5)',
|
|
269
273
|
...(optedSkills.includes('agentic-design') ? ['/agentic-design (DESIGN.md)'] : []),
|
|
270
274
|
...(optedSkills.includes('agentic-subagent') && agents.includes('claude-code')
|
|
271
275
|
? ['/agentic-subagent']
|
package/src/lib/rootdoc.js
CHANGED
|
@@ -17,11 +17,15 @@ export const SKILL_DESCRIPTIONS = {
|
|
|
17
17
|
'Universal agent guardrails (think before coding, verify before claiming done). Auto-loads on non-trivial work.',
|
|
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
|
+
'agentic-spec':
|
|
21
|
+
'Draft a feature spec at `doc/specs/NNNN-<slug>.md` (Spec Kit-aligned mandatory sections). Layer 2 of the four-layer artifact stack.',
|
|
20
22
|
'agentic-task': 'Draft a new task at `doc/tasks/NNNN-<slug>.md`.',
|
|
21
23
|
'agentic-audit':
|
|
22
24
|
'Read-only drift report comparing AGENTS.md / ARCHITECTURE.md / ADRs against the code.',
|
|
23
25
|
'agentic-review':
|
|
24
26
|
'Fresh-context code review per WORKFLOW §10 — assemble handoff, return structured findings.',
|
|
27
|
+
'agentic-ground':
|
|
28
|
+
'Four-source pre-implementation research (docs / OSS / in-repo / git history) + happy-path synthesis + deviation gate. WORKFLOW §4 + §5.',
|
|
25
29
|
'agentic-design': 'Bootstrap `DESIGN.md` from existing tokens (frontend projects).',
|
|
26
30
|
'agentic-subagent': 'Draft a new Claude Code subagent at `.claude/agents/<name>.md`.',
|
|
27
31
|
'agentic-skill': 'Draft a new Claude Code or Codex skill at the appropriate path.',
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-ground
|
|
3
|
+
description: Four-source pre-implementation research — official docs, validated open-source examples, in-repo patterns, and git history — then synthesize a happy path and gate any deviation with an irrefutable justification before code is written. Auto-invokes on non-trivial work, refactors, library or pattern selection, "research before coding", "before implementing", "which library", "which pattern", "how to approach", "ground before coding". Workflow-operational counterpart to WORKFLOW.md §4 (Find the Happy Path) and §5 (Ground in Real Patterns); pairs with agentic-philosophy (posture) and agentic-review (post-implementation §10 review).
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash, WebFetch, WebSearch
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /agentic-ground
|
|
8
|
+
|
|
9
|
+
Implements WORKFLOW §4 + §5 end-to-end as a single research pass. The four sources are joined by **AND**, not OR — every non-trivial change runs the full levantamento, then synthesizes a happy path, then justifies any deviation. Output is the input to whatever skill or freeform turn produces the implementation plan; this skill does not write code.
|
|
10
|
+
|
|
11
|
+
## Step 0 — Scope the recortte
|
|
12
|
+
|
|
13
|
+
Confirm what is being researched. The recortte is the smallest verifiable surface that captures the change: a function to add, a library to pick, a pattern to apply. State it in one sentence before research starts. If the surface is broader than one sentence captures, ask the user to narrow it; broad recorttes produce diluted research.
|
|
14
|
+
|
|
15
|
+
If the change is genuinely trivial (rename, typo, one-line refactor on a tested path), skip this skill.
|
|
16
|
+
|
|
17
|
+
## Step 1 — Four-source levantamento (all four required)
|
|
18
|
+
|
|
19
|
+
### Source A — official documentation
|
|
20
|
+
|
|
21
|
+
For each language and library in scope, cite the canonical doc URL and version. Use `WebFetch` to confirm the page exists and read the relevant section; use `WebSearch` to locate it if the URL is unknown. If neither produces a confident hit, ask the user for a known-good link rather than fabricating one. Output: bulleted citations, one per language/library, each with URL plus a one-line summary of the relevant guidance.
|
|
22
|
+
|
|
23
|
+
### Source B — validated open-source examples
|
|
24
|
+
|
|
25
|
+
Find ≥1 (prefer 2–3) public repository solving the same *technical* recortte with similar techniques. The match is technical, not domain — a CRUD-app-with-auth and a CLI-with-auth both hit "auth flow", and either is valid for the auth recortte. Use `WebSearch` (e.g. `site:github.com <recortte> language:<lang>`) and follow up with `WebFetch` of the specific file. Cite `<repo>:<path>:<line-range>` and quote the relevant block — never paraphrase code from training memory. If search is inconclusive, ask the user for a known reference.
|
|
26
|
+
|
|
27
|
+
### Source C — in-repo examples
|
|
28
|
+
|
|
29
|
+
Grep / glob the current repo for analogous patterns. Cite `<file>:<line>` plus a one-line description of how the existing example handles the same shape. If the codebase has no analog, state that explicitly (real signal, not a gap).
|
|
30
|
+
|
|
31
|
+
### Source D — git history
|
|
32
|
+
|
|
33
|
+
Run `git log --all --oneline -- <relevant-paths>`, `git log --all --grep=<keyword>`, and a sweep of sibling active branches (`git branch -a`, then `git log <branch> -- <paths>` on those that look related). Surface any prior attempt or sibling solution — including abandoned ones — with `<commit-sha>` plus the touching file path and a one-line description. If the search is genuinely empty, state "no prior attempt found" — that is the valid Source D outcome when there isn't one. Narrow with `--grep` or `-S` on multi-thousand-commit repos.
|
|
34
|
+
|
|
35
|
+
## Step 2 — Happy path synthesis
|
|
36
|
+
|
|
37
|
+
In one paragraph, name the most-grounded approach for the recortte and cite at least one source per Source A / B / C. Source D is included when it produced a hit; otherwise mark "no prior attempt found." The paragraph is the canonical answer the engineer would give if asked "what is the canonical, idiomatic way to solve this here?" — the question WORKFLOW.md §4 frames.
|
|
38
|
+
|
|
39
|
+
## Step 3 — Deviation gate
|
|
40
|
+
|
|
41
|
+
If the implementation the user (or you) is about to write deviates from the synthesized happy path, write the justification before any code lands. The justification must name the specific constraint, evidence, or trade-off forcing the deviation — generic "we want it differently" is insufficient. If the justification cannot be written confidently, loop back to Step 1 and look harder; do not deviate without it.
|
|
42
|
+
|
|
43
|
+
The gate is prescriptive, not descriptive: WORKFLOW §4 asks "was the deviation deliberate?"; this gate asks "is the deviation defensible against the four sources?" Write the answer down.
|
|
44
|
+
|
|
45
|
+
## Step 4 — Confidence checkpoint
|
|
46
|
+
|
|
47
|
+
Before handing off to implementation, report a soft verdict against four checks:
|
|
48
|
+
|
|
49
|
+
- A consulted (≥1 official-doc citation per language/library)
|
|
50
|
+
- B consulted (≥1 OSS citation, with cite-and-fetched code)
|
|
51
|
+
- C consulted (in-repo analog cited or "no analog found" stated)
|
|
52
|
+
- D checked (commits / branches surveyed; hit cited or "no prior attempt found")
|
|
53
|
+
- Happy path declared (Step 2)
|
|
54
|
+
- Deviation, if any, justified (Step 3)
|
|
55
|
+
|
|
56
|
+
If any check fails, surface the gap to the user and ask before proceeding rather than blocking. The user retains the authority to skip; the discipline is in surfacing, not in enforcement.
|
|
57
|
+
|
|
58
|
+
## Output contract
|
|
59
|
+
|
|
60
|
+
A single message structured as:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
## Recortte
|
|
64
|
+
<one sentence>
|
|
65
|
+
|
|
66
|
+
## Source A — official documentation
|
|
67
|
+
- <lang/lib>: <URL@version> — <one-line summary>
|
|
68
|
+
|
|
69
|
+
## Source B — validated open-source examples
|
|
70
|
+
- <repo>:<path>:<line-range> — <one-line summary>
|
|
71
|
+
```
|
|
72
|
+
<quoted code block>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Source C — in-repo examples
|
|
76
|
+
- <file>:<line> — <one-line summary>
|
|
77
|
+
- (or: "no analog found in the codebase")
|
|
78
|
+
|
|
79
|
+
## Source D — git history
|
|
80
|
+
- <commit-sha> <touching-path> — <one-line summary>
|
|
81
|
+
- (or: "no prior attempt found")
|
|
82
|
+
|
|
83
|
+
## Happy path
|
|
84
|
+
<one paragraph synthesizing A + B + C + D, with citations>
|
|
85
|
+
|
|
86
|
+
## Proposed implementation vs happy path
|
|
87
|
+
- aligned: <what stays canonical>
|
|
88
|
+
- deviates: <list of deviations>
|
|
89
|
+
- <deviation>: <irrefutable justification>
|
|
90
|
+
|
|
91
|
+
## Confidence checkpoint
|
|
92
|
+
- A consulted: yes / no — <gap if no>
|
|
93
|
+
- B consulted: yes / no — <gap if no>
|
|
94
|
+
- C consulted: yes / no — <gap if no>
|
|
95
|
+
- D checked: yes / no — <gap if no>
|
|
96
|
+
- happy path declared: yes
|
|
97
|
+
- deviations justified: yes / no / n.a.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
No code is written by this skill. The output feeds the next turn (or `/agentic-task`, `/agentic-philosophy`'s Goal-Driven Execution, or freeform implementation).
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-spec
|
|
3
|
+
description: Draft a feature-level specification at doc/specs/NNNN-<slug>.md following the kit's four-layer artifact stack (Constitution → 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
|
+
allowed-tools: Read, Write, Glob, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /agentic-spec
|
|
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-2 artifact in the kit's four-layer stack — Constitution (`AGENTS.md` + `WORKFLOW.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.
|
|
10
|
+
|
|
11
|
+
## Step 1 — Determine NNNN and slug
|
|
12
|
+
|
|
13
|
+
List `doc/specs/`. NNNN = next available 4-digit number after the highest existing (mirrors the ADR and task conventions). If `doc/specs/` does not exist, create it; start at `0001`. Slug: kebab-case, ≤6 words, derived from the feature title.
|
|
14
|
+
|
|
15
|
+
## Step 2 — Confirm scope
|
|
16
|
+
|
|
17
|
+
The spec captures **one** feature. If the user's request implies multiple features, ask which one to write first; the others become follow-up specs. A "feature" here is the smallest user-visible outcome that has its own success criteria — not a task (work unit) and not a binding architectural decision (ADR).
|
|
18
|
+
|
|
19
|
+
## Step 3 — Interview to fill
|
|
20
|
+
|
|
21
|
+
Ask one question per missing field, in this order. Skip the philosophical questions and the questions whose answers are already obvious from the conversation.
|
|
22
|
+
|
|
23
|
+
* **Context:** business context first per ADR-0008. *Why* the feature exists, the user / constraint / problem it addresses, the cost of *not* building it.
|
|
24
|
+
* **User Scenarios:** Given-When-Then for the key flows. Each scenario must be independently testable. Multiple scenarios when the feature has more than one path.
|
|
25
|
+
* **Functional Requirements:** testable statements. Each as a checkbox. *"User can sign in with email and password"* — yes. *"Authentication should be secure"* — no, that's not a requirement, it's a hope.
|
|
26
|
+
* **Non-functional Requirements:** performance, security, accessibility, observability — only the constraints that bind. Skip when there are none.
|
|
27
|
+
* **Success Criteria:** measurable per [`WORKFLOW.md` §1](../../WORKFLOW.md). Each as a checkbox. Pass/fail must be observable, not aspirational. *"Loads in under 2 seconds at p95 over 7 days"* — yes. *"Loads fast"* — no.
|
|
28
|
+
* **Edge Cases:** empty inputs, large inputs, concurrent access, missing prerequisites, permission errors. Surface them before code is written, not after a bug report.
|
|
29
|
+
* **Out of Scope:** explicit non-goals. Anything readers might assume is in scope but isn't. Prevents scope creep without an audit trail.
|
|
30
|
+
* **Open Questions:** deferred decisions. Each becomes a follow-up ADR or an explicit punt with a rationale.
|
|
31
|
+
* **Related:** ADRs touched by this spec, tasks implementing it (filled lazily as tasks are created), other specs this one supersedes or depends on.
|
|
32
|
+
|
|
33
|
+
Status starts at `draft`. Created: today, ISO format. Owner: ask. Do **not** invent values — when the user does not know, leave `<TODO>` and ask.
|
|
34
|
+
|
|
35
|
+
## Step 4 — Write the file
|
|
36
|
+
|
|
37
|
+
Path: `doc/specs/<NNNN>-<short-slug>.md`. Use the template below.
|
|
38
|
+
|
|
39
|
+
Stop after writing. Do **not** flip status to `accepted` — that requires user review.
|
|
40
|
+
|
|
41
|
+
## Step 5 — Editing guidance for later turns
|
|
42
|
+
|
|
43
|
+
When the user later works on the spec, edit the file by:
|
|
44
|
+
|
|
45
|
+
* Toggling Success Criteria checkboxes as feature lands incrementally.
|
|
46
|
+
* Appending to **Open Questions** (close them with the resolution; never delete them).
|
|
47
|
+
* Flipping `Status` to `accepted` once the user signs off and tasks start being created.
|
|
48
|
+
* Flipping `Status` to `shipped` after release.
|
|
49
|
+
* Flipping `Status` to `superseded by SPEC-NNNN` when a later spec replaces this one.
|
|
50
|
+
* Adding `Tasks` entries to `Related` as tasks are created against this spec.
|
|
51
|
+
|
|
52
|
+
Never rewrite existing prose — append rationale to **Open Questions** as a resolution paragraph rather than mutating the original requirement text.
|
|
53
|
+
|
|
54
|
+
## Template — `doc/specs/NNNN-<slug>.md`
|
|
55
|
+
|
|
56
|
+
````markdown
|
|
57
|
+
# Spec `<NNNN>`: `<short imperative title>`
|
|
58
|
+
|
|
59
|
+
**Status:** `<draft | accepted | shipped | superseded by SPEC-NNNN>`
|
|
60
|
+
**Created:** `<YYYY-MM-DD>`
|
|
61
|
+
**Owner:** `<name or role>`
|
|
62
|
+
|
|
63
|
+
## Context
|
|
64
|
+
|
|
65
|
+
`<Why this feature exists. The user, the constraint, the problem. What would break if this feature did not ship.>`
|
|
66
|
+
|
|
67
|
+
## User Scenarios
|
|
68
|
+
|
|
69
|
+
`<Given-When-Then for the key flows. Each scenario independently testable.>`
|
|
70
|
+
|
|
71
|
+
- **Scenario 1:** `<short title>`
|
|
72
|
+
- Given `<starting state>`
|
|
73
|
+
- When `<action>`
|
|
74
|
+
- Then `<observable outcome>`
|
|
75
|
+
|
|
76
|
+
## Requirements
|
|
77
|
+
|
|
78
|
+
### Functional
|
|
79
|
+
|
|
80
|
+
- [ ] `<R1: testable statement>`
|
|
81
|
+
- [ ] `<R2>`
|
|
82
|
+
|
|
83
|
+
### Non-functional
|
|
84
|
+
|
|
85
|
+
- [ ] `<perf / security / a11y / observability — only when binding>`
|
|
86
|
+
|
|
87
|
+
## Success Criteria
|
|
88
|
+
|
|
89
|
+
Measurable conditions. Each as a checkbox; pass/fail observable, not aspirational.
|
|
90
|
+
|
|
91
|
+
- [ ] `<criterion 1: measurable, observable>`
|
|
92
|
+
- [ ] `<criterion 2>`
|
|
93
|
+
|
|
94
|
+
## Edge Cases
|
|
95
|
+
|
|
96
|
+
- `<empty input behavior>`
|
|
97
|
+
- `<large input / failure modes>`
|
|
98
|
+
- `<permission / concurrency / state-restoration cases>`
|
|
99
|
+
|
|
100
|
+
## Out of Scope
|
|
101
|
+
|
|
102
|
+
`<Explicit non-goals. Anything readers might assume is in scope but isn't.>`
|
|
103
|
+
|
|
104
|
+
## Open Questions
|
|
105
|
+
|
|
106
|
+
`<Deferred decisions. Each becomes an ADR or a documented punt.>`
|
|
107
|
+
|
|
108
|
+
## Related
|
|
109
|
+
|
|
110
|
+
- ADRs: `<list with links — written as the spec is accepted>`
|
|
111
|
+
- Tasks: `<doc/tasks/NNNN-... — appended as tasks are created>`
|
|
112
|
+
- Supersedes / Depends on: `<other spec links if any>`
|
|
113
|
+
````
|
|
114
|
+
|
|
115
|
+
## Output contract
|
|
116
|
+
|
|
117
|
+
A single new file at `doc/specs/<NNNN>-<short-slug>.md`. Status `draft`. Tasks list empty (filled lazily as tasks land). No existing specs modified. No invented values.
|
|
118
|
+
|
|
119
|
+
The spec is a narrative document but is exempt from ADR-0008's no-dates rule for the same reason ADRs and tasks are: the `Status` lifecycle and `Created` field are part of the auditability primitive. The remaining documentation discipline rules apply at write time:
|
|
120
|
+
|
|
121
|
+
- No emoji anywhere in the file.
|
|
122
|
+
- `Context` is the business-context-first section — *why* the feature exists before *what* it does.
|
|
123
|
+
- One scope: one feature per spec. Multiple features implies multiple specs.
|
|
124
|
+
- No speculation. Open Questions go in their named section; everywhere else captures decisions.
|
|
125
|
+
- No commented-out requirements or TODO/FIXME — every deferred item references a tracked work item or lives under Open Questions.
|
|
@@ -20,6 +20,7 @@ Ask one question per missing field, in this order:
|
|
|
20
20
|
* **Acceptance Criteria:** measurable conditions. Each is a checkbox; pass/fail must be observable, not aspirational ("loads in under 2s", not "fast enough").
|
|
21
21
|
* **Plan:** concrete sequential steps with file paths where applicable. Each is a checkbox.
|
|
22
22
|
* **Owner:** ask.
|
|
23
|
+
* **Spec ref:** ask; leave blank when no spec drives this task. When a feature spec exists at `doc/specs/NNNN-<slug>.md`, link it here so the spec's `Related → Tasks` list reciprocates.
|
|
23
24
|
* **Board ref:** ask; leave blank if solo work.
|
|
24
25
|
|
|
25
26
|
Status starts at `proposed`. Created: today, ISO format. Notes: empty (filled during execution). Definition of Done section: copy verbatim from the template.
|
|
@@ -48,7 +49,8 @@ Status flips to `done` only when every Acceptance Criterion and every Definition
|
|
|
48
49
|
**Status:** `<proposed | in-progress | blocked | done>`
|
|
49
50
|
**Created:** `<YYYY-MM-DD>`
|
|
50
51
|
**Owner:** `<name or role>`
|
|
51
|
-
**
|
|
52
|
+
**Spec ref:** `<doc/specs/NNNN-<slug>.md or SPEC-NNNN — blank when no spec drives this task>`
|
|
53
|
+
**Board ref:** `<external ticket URL or ID — blank for solo work>`
|
|
52
54
|
|
|
53
55
|
## Context
|
|
54
56
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-ground
|
|
3
|
+
description: Four-source pre-implementation research — official docs, validated open-source examples, in-repo patterns, and git history — then synthesize a happy path and gate any deviation with an irrefutable justification before code is written. Auto-invokes on non-trivial work, refactors, library or pattern selection, "research before coding", "before implementing", "which library", "which pattern", "how to approach", "ground before coding". Workflow-operational counterpart to WORKFLOW.md §4 (Find the Happy Path) and §5 (Ground in Real Patterns).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<background_information>
|
|
7
|
+
Implements WORKFLOW §4 + §5 end-to-end as one research pass. The four sources are joined by AND, not OR — every non-trivial change runs the full levantamento, then synthesizes a happy path, then justifies any deviation. Output is the input to whatever skill or freeform turn produces the implementation plan; this skill does not write code.
|
|
8
|
+
|
|
9
|
+
Codex auto-trigger on description keywords is less mature than Claude Code's. If auto-invocation does not fire on a non-trivial change, invoke this skill manually before implementing.
|
|
10
|
+
</background_information>
|
|
11
|
+
|
|
12
|
+
<instructions>
|
|
13
|
+
Step 0 — scope the recortte. Confirm what is being researched in one sentence. The recortte is the smallest verifiable surface that captures the change: a function to add, a library to pick, a pattern to apply. If broader than one sentence, ask the user to narrow. Skip the skill on genuinely trivial diffs (rename, typo, one-line refactor on a tested path).
|
|
14
|
+
|
|
15
|
+
Step 1 — four-source levantamento, all four required:
|
|
16
|
+
|
|
17
|
+
Source A — official documentation. For each language and library in scope, cite the canonical doc URL and version. Read the relevant section. Ask the user for a known-good link rather than fabricating one. Output: bulleted citations, one per language/library, each with URL plus a one-line summary.
|
|
18
|
+
|
|
19
|
+
Source B — validated open-source examples. ≥1 (prefer 2–3) public repository solving the same technical recortte with similar techniques. Match is technical, not domain. Cite `<repo>:<path>:<line-range>` and quote the relevant block — never paraphrase from training memory. If search is inconclusive, ask the user for a known reference.
|
|
20
|
+
|
|
21
|
+
Source C — in-repo examples. Grep / glob for analogous patterns. Cite `<file>:<line>` plus a one-line description of how the existing example handles the same shape. If the codebase has no analog, state that explicitly.
|
|
22
|
+
|
|
23
|
+
Source D — git history. Run `git log --all --oneline -- <relevant-paths>`, `git log --all --grep=<keyword>`, sweep sibling active branches. Cite `<commit-sha>` plus touching file path and a one-line description. If empty, state "no prior attempt found." Narrow with `--grep` or `-S` on multi-thousand-commit repos.
|
|
24
|
+
|
|
25
|
+
Step 2 — happy path synthesis. In one paragraph, name the most-grounded approach for the recortte and cite at least one source per Source A / B / C. Source D included when it produced a hit; otherwise mark "no prior attempt found." The paragraph is the canonical answer to "what is the canonical, idiomatic way to solve this here?"
|
|
26
|
+
|
|
27
|
+
Step 3 — deviation gate. If the implementation about to be written deviates from the happy path, write the justification first. Must name the specific constraint, evidence, or trade-off forcing the deviation — generic "we want it differently" is insufficient. If the justification cannot be written confidently, loop back to Step 1 and look harder; do not deviate without it. Prescriptive gate, not descriptive — write the answer down.
|
|
28
|
+
|
|
29
|
+
Step 4 — confidence checkpoint. Soft verdict on:
|
|
30
|
+
- A consulted (≥1 official-doc citation per language/library)
|
|
31
|
+
- B consulted (≥1 OSS citation, with cite-and-fetched code)
|
|
32
|
+
- C consulted (in-repo analog cited or "no analog found" stated)
|
|
33
|
+
- D checked (commits / branches surveyed; hit cited or "no prior attempt found")
|
|
34
|
+
- Happy path declared (Step 2)
|
|
35
|
+
- Deviation, if any, justified (Step 3)
|
|
36
|
+
|
|
37
|
+
If any check fails, surface the gap to the user and ask before proceeding. Do not block. The user retains authority to skip; the discipline is in surfacing.
|
|
38
|
+
</instructions>
|
|
39
|
+
|
|
40
|
+
<output_contract>
|
|
41
|
+
A single message structured as:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
## Recortte
|
|
45
|
+
<one sentence>
|
|
46
|
+
|
|
47
|
+
## Source A — official documentation
|
|
48
|
+
- <lang/lib>: <URL@version> — <one-line summary>
|
|
49
|
+
|
|
50
|
+
## Source B — validated open-source examples
|
|
51
|
+
- <repo>:<path>:<line-range> — <one-line summary>
|
|
52
|
+
```
|
|
53
|
+
<quoted code block>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Source C — in-repo examples
|
|
57
|
+
- <file>:<line> — <one-line summary>
|
|
58
|
+
- (or: "no analog found in the codebase")
|
|
59
|
+
|
|
60
|
+
## Source D — git history
|
|
61
|
+
- <commit-sha> <touching-path> — <one-line summary>
|
|
62
|
+
- (or: "no prior attempt found")
|
|
63
|
+
|
|
64
|
+
## Happy path
|
|
65
|
+
<one paragraph synthesizing A + B + C + D, with citations>
|
|
66
|
+
|
|
67
|
+
## Proposed implementation vs happy path
|
|
68
|
+
- aligned: <what stays canonical>
|
|
69
|
+
- deviates: <list of deviations>
|
|
70
|
+
- <deviation>: <irrefutable justification>
|
|
71
|
+
|
|
72
|
+
## Confidence checkpoint
|
|
73
|
+
- A consulted: yes / no — <gap if no>
|
|
74
|
+
- B consulted: yes / no — <gap if no>
|
|
75
|
+
- C consulted: yes / no — <gap if no>
|
|
76
|
+
- D checked: yes / no — <gap if no>
|
|
77
|
+
- happy path declared: yes
|
|
78
|
+
- deviations justified: yes / no / n.a.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
No code is written by this skill. The output feeds the next turn or another skill.
|
|
82
|
+
</output_contract>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-spec
|
|
3
|
+
description: Draft a feature-level specification at doc/specs/NNNN-<slug>.md following the four-layer artifact stack (Constitution → 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
|
+
---
|
|
5
|
+
|
|
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-2 artifact in the kit's four-layer stack — Constitution (`AGENTS.md` + `WORKFLOW.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.
|
|
8
|
+
|
|
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
|
+
</background_information>
|
|
11
|
+
|
|
12
|
+
<instructions>
|
|
13
|
+
Step 1 — determine NNNN and slug. List `doc/specs/`. NNNN = next available 4-digit number after the highest existing (mirrors ADR and task conventions). If `doc/specs/` does not exist, create it; start at 0001. Slug: kebab-case, ≤6 words, derived from the feature title.
|
|
14
|
+
|
|
15
|
+
Step 2 — confirm scope. The spec captures one feature. If the user's request implies multiple, ask which to write first; the others become follow-up specs. A "feature" here is the smallest user-visible outcome that has its own success criteria — not a task (work unit) and not a binding architectural decision (ADR).
|
|
16
|
+
|
|
17
|
+
Step 3 — interview to fill. Ask one question per missing field, in this order:
|
|
18
|
+
- Context: business context first per ADR-0008. Why the feature exists, the user / constraint / problem it addresses, the cost of not building it.
|
|
19
|
+
- User Scenarios: Given-When-Then for the key flows. Each scenario independently testable.
|
|
20
|
+
- Functional Requirements: testable statements. Each as a checkbox.
|
|
21
|
+
- Non-functional Requirements: perf / security / a11y / observability — only when binding.
|
|
22
|
+
- Success Criteria: measurable per WORKFLOW.md §1. Each as a checkbox; pass/fail observable, not aspirational.
|
|
23
|
+
- Edge Cases: empty inputs, large inputs, concurrent access, missing prerequisites, permission errors.
|
|
24
|
+
- Out of Scope: explicit non-goals.
|
|
25
|
+
- Open Questions: deferred decisions. Each becomes an ADR or a documented punt.
|
|
26
|
+
- Related: ADRs touched, tasks implementing it (lazy), other specs this one supersedes or depends on.
|
|
27
|
+
|
|
28
|
+
Status starts at draft. Created: today, ISO format. Owner: ask. Do NOT invent values; leave `<TODO>` and ask.
|
|
29
|
+
|
|
30
|
+
Step 4 — write the file. Path: `doc/specs/<NNNN>-<short-slug>.md`. Use the template below.
|
|
31
|
+
|
|
32
|
+
Stop after writing. Do NOT flip status to accepted — that requires user review.
|
|
33
|
+
|
|
34
|
+
Step 5 — editing guidance for later turns. Toggle Success Criteria checkboxes as feature lands. Append to Open Questions; close with resolution paragraphs, never delete. Flip Status to accepted on user sign-off, shipped after release, superseded when replaced. Add tasks to Related as they are created. Never rewrite existing prose — append rationale to Open Questions rather than mutating original requirement text.
|
|
35
|
+
</instructions>
|
|
36
|
+
|
|
37
|
+
<template path="doc/specs/NNNN-<slug>.md">
|
|
38
|
+
# Spec `<NNNN>`: `<short imperative title>`
|
|
39
|
+
|
|
40
|
+
**Status:** `<draft | accepted | shipped | superseded by SPEC-NNNN>`
|
|
41
|
+
**Created:** `<YYYY-MM-DD>`
|
|
42
|
+
**Owner:** `<name or role>`
|
|
43
|
+
|
|
44
|
+
## Context
|
|
45
|
+
|
|
46
|
+
`<Why this feature exists. The user, the constraint, the problem. What would break if this feature did not ship.>`
|
|
47
|
+
|
|
48
|
+
## User Scenarios
|
|
49
|
+
|
|
50
|
+
`<Given-When-Then for the key flows. Each scenario independently testable.>`
|
|
51
|
+
|
|
52
|
+
- **Scenario 1:** `<short title>`
|
|
53
|
+
- Given `<starting state>`
|
|
54
|
+
- When `<action>`
|
|
55
|
+
- Then `<observable outcome>`
|
|
56
|
+
|
|
57
|
+
## Requirements
|
|
58
|
+
|
|
59
|
+
### Functional
|
|
60
|
+
|
|
61
|
+
- [ ] `<R1: testable statement>`
|
|
62
|
+
- [ ] `<R2>`
|
|
63
|
+
|
|
64
|
+
### Non-functional
|
|
65
|
+
|
|
66
|
+
- [ ] `<perf / security / a11y / observability — only when binding>`
|
|
67
|
+
|
|
68
|
+
## Success Criteria
|
|
69
|
+
|
|
70
|
+
Measurable conditions. Each as a checkbox; pass/fail observable, not aspirational.
|
|
71
|
+
|
|
72
|
+
- [ ] `<criterion 1: measurable, observable>`
|
|
73
|
+
- [ ] `<criterion 2>`
|
|
74
|
+
|
|
75
|
+
## Edge Cases
|
|
76
|
+
|
|
77
|
+
- `<empty input behavior>`
|
|
78
|
+
- `<large input / failure modes>`
|
|
79
|
+
- `<permission / concurrency / state-restoration cases>`
|
|
80
|
+
|
|
81
|
+
## Out of Scope
|
|
82
|
+
|
|
83
|
+
`<Explicit non-goals. Anything readers might assume is in scope but isn't.>`
|
|
84
|
+
|
|
85
|
+
## Open Questions
|
|
86
|
+
|
|
87
|
+
`<Deferred decisions. Each becomes an ADR or a documented punt.>`
|
|
88
|
+
|
|
89
|
+
## Related
|
|
90
|
+
|
|
91
|
+
- ADRs: `<list with links — written as the spec is accepted>`
|
|
92
|
+
- Tasks: `<doc/tasks/NNNN-... — appended as tasks are created>`
|
|
93
|
+
- Supersedes / Depends on: `<other spec links if any>`
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<output_contract>
|
|
97
|
+
A single new file at `doc/specs/<NNNN>-<short-slug>.md`. Status draft. Tasks list empty (filled lazily as tasks land). No existing specs modified. No invented values.
|
|
98
|
+
|
|
99
|
+
Spec is a narrative document but is exempt from ADR-0008's no-dates rule for the same reason ADRs and tasks are: the Status lifecycle and Created field are part of the auditability primitive. Remaining documentation discipline rules apply at write time:
|
|
100
|
+
- No emoji anywhere in the file.
|
|
101
|
+
- Context is the business-context-first section — why the feature exists before what it does.
|
|
102
|
+
- One scope: one feature per spec.
|
|
103
|
+
- No speculation. Open Questions go in their named section.
|
|
104
|
+
- No commented-out requirements or TODO/FIXME — every deferred item references a tracked work item or lives under Open Questions.
|
|
105
|
+
</output_contract>
|
|
@@ -15,6 +15,7 @@ Step 2 — interview to fill. Ask one question per missing field, in this order:
|
|
|
15
15
|
- Acceptance Criteria: measurable conditions. Each is a checkbox; pass/fail must be observable, not aspirational ("loads in under 2s", not "fast enough").
|
|
16
16
|
- Plan: concrete sequential steps with file paths where applicable. Each is a checkbox.
|
|
17
17
|
- Owner: ask.
|
|
18
|
+
- Spec ref: ask; leave blank when no spec drives this task. When a feature spec exists at `doc/specs/NNNN-<slug>.md`, link it here so the spec's Related → Tasks list reciprocates.
|
|
18
19
|
- Board ref: ask; leave blank if solo work.
|
|
19
20
|
|
|
20
21
|
Status starts at proposed. Created: today, ISO format. Notes: empty. Definition of Done section: copy verbatim from the template.
|
|
@@ -37,7 +38,8 @@ Status flips to done only when every Acceptance Criterion and every Definition o
|
|
|
37
38
|
**Status:** `<proposed | in-progress | blocked | done>`
|
|
38
39
|
**Created:** `<YYYY-MM-DD>`
|
|
39
40
|
**Owner:** `<name or role>`
|
|
40
|
-
**
|
|
41
|
+
**Spec ref:** `<doc/specs/NNNN-<slug>.md or SPEC-NNNN — blank when no spec drives this task>`
|
|
42
|
+
**Board ref:** `<external ticket URL or ID — blank for solo work>`
|
|
41
43
|
|
|
42
44
|
## Context
|
|
43
45
|
|
package/templates/task.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
**Status:** `<proposed | in-progress | blocked | done>`
|
|
4
4
|
**Created:** `<YYYY-MM-DD>`
|
|
5
5
|
**Owner:** `<name or role>`
|
|
6
|
-
**
|
|
6
|
+
**Spec ref:** `<doc/specs/NNNN-<slug>.md or SPEC-NNNN — blank when no spec drives this task>`
|
|
7
|
+
**Board ref:** `<external ticket URL or ID — blank for solo work>`
|
|
7
8
|
|
|
8
9
|
## Context
|
|
9
10
|
|