@alexandrealvaro/agentic 0.6.0-beta.1 → 0.7.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
@@ -40,6 +40,7 @@ Two categories ([ADR-0007](doc/adr/0007-workflow-operational-skills.md)) and two
40
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` |
41
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` |
42
42
  | `agentic-skill` | spec-driven | opt-in only | Drafts a new Claude Code or Codex skill at the appropriate path | `/agentic-skill` |
43
+ | `agentic-hooks` | workflow-operational | opt-in only | Scaffolds deterministic quality gates per WORKFLOW §11 (pre-commit + pre-push); detects stack and recommends a runner (Husky / lefthook / pre-commit / native) | `/agentic-hooks` |
43
44
 
44
45
  A short TUI shows the detected mode, agent, and feature signals (frontend / `.claude/` / `.agents/` presence) and lets you toggle the conditional skills. Non-interactive flags: `--agent claude-code | codex | both`, `--yes` to skip confirmations — auto-checked conditionals (e.g., `agentic-design` if the project has React) install; `agentic-skill` stays opt-in. Re-running on an installed project is idempotent — unchanged files report `·`, divergent ones prompt to replace.
45
46
 
@@ -118,7 +119,7 @@ The kit ships nine universal skills plus three conditional ones — twelve discr
118
119
  2. Decide whether the answer becomes a spec (`/agentic-spec`) or a one-off task (`/agentic-task`).
119
120
  3. Continue from step 6 of the greenfield flow.
120
121
 
121
- 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; CI + hooks (deferred see Task 0013) will eventually enforce the gates that today are advisory.
122
+ 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.
122
123
 
123
124
  ## Manual prompts
124
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandrealvaro/agentic",
3
- "version": "0.6.0-beta.1",
3
+ "version": "0.7.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": {
@@ -83,6 +83,13 @@ export const CONDITIONAL_SKILLS = [
83
83
  hintWhenAuto: 'opt-in',
84
84
  hintWhenManual: 'opt-in (rarely needed)',
85
85
  },
86
+ {
87
+ name: 'agentic-hooks',
88
+ autoIf: () => false,
89
+ agents: ['claude-code', 'codex'],
90
+ hintWhenAuto: 'opt-in',
91
+ hintWhenManual: 'WORKFLOW §11 hooks scaffolder (pre-commit, pre-push)',
92
+ },
86
93
  ];
87
94
 
88
95
  function resolveAgents(flagValue, detectedAgents) {
@@ -275,6 +282,7 @@ export async function initCommand(opts) {
275
282
  ? ['/agentic-subagent']
276
283
  : []),
277
284
  ...(optedSkills.includes('agentic-skill') ? ['/agentic-skill'] : []),
285
+ ...(optedSkills.includes('agentic-hooks') ? ['/agentic-hooks (WORKFLOW §11)'] : []),
278
286
  ].join(', ');
279
287
  p.outro(
280
288
  `Done. In ${agents
@@ -29,6 +29,8 @@ export const SKILL_DESCRIPTIONS = {
29
29
  'agentic-design': 'Bootstrap `DESIGN.md` from existing tokens (frontend projects).',
30
30
  'agentic-subagent': 'Draft a new Claude Code subagent at `.claude/agents/<name>.md`.',
31
31
  'agentic-skill': 'Draft a new Claude Code or Codex skill at the appropriate path.',
32
+ 'agentic-hooks':
33
+ 'Scaffold deterministic quality gates per WORKFLOW §11 — pre-commit + pre-push, runner detected from stack signals.',
32
34
  };
33
35
 
34
36
  /**
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: agentic-hooks
3
+ description: Scaffold deterministic quality gates per WORKFLOW.md §11 — pre-commit (lint, format, secret-scan), pre-push (build, unit, integration). Detects the project's stack and recommends a hook runner (Husky / lefthook / pre-commit / native), scaffolds the runner config, and updates AGENTS.md Quality Gates. Use when the user wants to wire hooks, configure pre-commit / pre-push, set up quality gates, prevent --no-verify bypass, or close the WORKFLOW §11 advisory-vs-deterministic gap. Opt-in skill; not auto-installed in the universal set.
4
+ allowed-tools: Read, Write, Glob, Bash
5
+ ---
6
+
7
+ # /agentic-hooks
8
+
9
+ Scaffolds the deterministic gates `WORKFLOW.md` §11 names. The skill writes config files for a hook runner and updates `AGENTS.md` Quality Gates; it does not execute install scripts. The user is responsible for the runner's one-time bootstrap (e.g., `npx husky init`, `lefthook install`, `pre-commit install`) — the skill says exactly which command to run.
10
+
11
+ ## Step 0 — Confirm the gates the user wants
12
+
13
+ `WORKFLOW.md` §11 names two tiers:
14
+
15
+ * **Pre-commit (fast):** lint, format, secret-scan. Runs on every commit. Slow pre-commits push devs to `--no-verify`; keep it under ~5s.
16
+ * **Pre-push (thorough):** build, unit tests, integration tests. Runs on every push. Acceptable to be slow; the cost is paid less often than commit.
17
+
18
+ Confirm both tiers are in scope for this project. If the user wants only one tier, scaffold only that tier — do not add gates the user did not ask for.
19
+
20
+ Visual / E2E for UI projects (Cypress, Playwright, Claude in Chrome) are mentioned by §11 but live in CI, not pre-push. Out of scope for this skill.
21
+
22
+ ## Step 1 — Detect the runner
23
+
24
+ Read the repo signals in this order:
25
+
26
+ 1. **Existing runner.** `.husky/` → Husky present. `lefthook.yml` or `.lefthook.yml` → lefthook present. `.pre-commit-config.yaml` → pre-commit present. `.git/hooks/` with non-sample scripts → native hooks present.
27
+ 2. **Stack signals (if no runner present).** `package.json` → Node-rooted; recommend Husky (most common in Node ecosystem) or lefthook (cross-language fit). `pyproject.toml` → Python-rooted; recommend pre-commit. `go.mod` → Go-rooted; recommend lefthook. `Cargo.toml` → Rust-rooted; recommend lefthook. Multiple stacks → recommend lefthook (cross-language by default).
28
+ 3. **No signals.** Recommend native `.git/hooks/` only as fallback. Warn the user that native hooks are not portable across clones (every contributor has to run a setup script).
29
+
30
+ If multiple runners are present, surface the conflict and ask the user before scaffolding. Never silently pick.
31
+
32
+ ## Step 2 — Recommend the per-stack commands
33
+
34
+ For the chosen runner, propose the per-tier command set:
35
+
36
+ * **Node (`package.json` present):** lint = `npm run lint` (fall back to `npx eslint .` if no `lint` script); format check = `npm run format:check` (fall back to `npx prettier --check .`); secret-scan = `gitleaks detect --no-banner` (cite the install instruction); build = `npm run build` (skip if no script); test = `npm test`.
37
+ * **Python (`pyproject.toml` present):** lint = `ruff check .`; format check = `ruff format --check .` or `black --check .`; secret-scan = `gitleaks detect --no-banner`; test = `pytest -q`.
38
+ * **Go (`go.mod` present):** lint = `golangci-lint run`; format check = `gofmt -d .`; secret-scan = `gitleaks detect --no-banner`; build = `go build ./...`; test = `go test ./...`.
39
+ * **Rust (`Cargo.toml` present):** lint = `cargo clippy -- -D warnings`; format check = `cargo fmt --check`; secret-scan = `gitleaks detect --no-banner`; build = `cargo build`; test = `cargo test`.
40
+ * **Mixed / other:** ask the user for the per-tier command list. Do not invent.
41
+
42
+ Offer to swap any default. Confirm before writing.
43
+
44
+ ## Step 3 — Scaffold the runner config
45
+
46
+ Write the runner-specific config file. Below are the canonical shapes; adapt to the user's tier choices.
47
+
48
+ **Husky** — `.husky/pre-commit` and `.husky/pre-push` (shell scripts). Plus a `prepare` script in `package.json` (`"prepare": "husky"`). User runs `npm install` once to bootstrap.
49
+
50
+ **lefthook** — `lefthook.yml` at the repo root with `pre-commit` and `pre-push` commands keyed by stage. User runs `lefthook install` once.
51
+
52
+ **pre-commit (pre-commit.com)** — `.pre-commit-config.yaml` referencing the canonical hooks for the stack (e.g., `pre-commit/mirrors-eslint`, `psf/black`, `astral-sh/ruff-pre-commit`). User runs `pre-commit install` and `pre-commit install --hook-type pre-push`.
53
+
54
+ **Native `.git/hooks/`** — `.git/hooks/pre-commit` and `.git/hooks/pre-push` plus a `setup-hooks.sh` script the user runs after every clone (since `.git/` is not committed). Document the setup-script invocation in `AGENTS.md`.
55
+
56
+ ## Step 4 — Update `AGENTS.md` Quality Gates section
57
+
58
+ Append (or refresh, if a Quality Gates section already exists) the following content:
59
+
60
+ ```
61
+ ## Quality Gates
62
+
63
+ Deterministic enforcement — agent cannot skip.
64
+
65
+ - Pre-commit hook (fast): <stack-specific lint, format, secret-scan commands>
66
+ - Pre-push hook (thorough): <stack-specific build, unit, integration commands>
67
+ - Hook runner: <Husky | lefthook | pre-commit | native>; config at <path>
68
+ - Bootstrap: <one-line setup command>
69
+ - CI blocks on: <list — skip if CI not yet wired>
70
+ - Never bypass: no `--no-verify`, no skipped hooks, no deleted failing tests. WORKFLOW §11 is binding.
71
+ ```
72
+
73
+ Honor the existing managed-skills / managed-quality-gates markers if `agentic-bootstrap` already wrote a Quality Gates section. The skill refreshes the section in place; user content outside the markers is preserved.
74
+
75
+ ## Step 5 — Tell the user what to run
76
+
77
+ After writing the config, output exactly the bootstrap command the user must run (e.g., `npm install` for Husky, `lefthook install` for lefthook, `pre-commit install` for pre-commit). The skill does not execute the bootstrap — that is the user's call.
78
+
79
+ If the user is wiring CI alongside hooks (GitHub Actions / GitLab CI / Circle), point them at the existing `.github/workflows/`, `.gitlab-ci.yml`, or `.circleci/` directory. CI scaffolding is a separate skill's responsibility (deferred — not this one).
80
+
81
+ ## Output contract
82
+
83
+ Filesystem changes:
84
+
85
+ - The runner's config file (e.g., `.husky/pre-commit`, `lefthook.yml`, `.pre-commit-config.yaml`).
86
+ - An updated `AGENTS.md` Quality Gates section (or appended if absent), naming the runner, the gates wired, the bootstrap command, and the no-bypass policy.
87
+ - For the native-hooks fallback only: a `setup-hooks.sh` script the user runs after every clone.
88
+
89
+ The skill does not execute the runner's install command. The skill does not write CI config. The skill does not configure agent-side hooks (`.claude/settings.json` `Stop` / `PreToolUse` / `PostToolUse`) — that is a different surface; future ADR may cover it.
90
+
91
+ A narrative document, so the documentation discipline rules apply at write time:
92
+
93
+ - No emoji anywhere in the scaffolded config or in the AGENTS.md update.
94
+ - No version stamps or DRAFT markers.
95
+ - The Quality Gates section opens with the operational rule (gates are deterministic) before listing the gates themselves.
96
+ - One scope: Quality Gates. Do not duplicate ARCHITECTURE.md or ADR rationale here.
97
+ - No commented-out scripts. No orphan TODO / FIXME — every deferred command references a tracked task or GitHub Issue.
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: agentic-hooks
3
+ description: Scaffold deterministic quality gates per WORKFLOW.md §11 — pre-commit (lint, format, secret-scan), pre-push (build, unit, integration). Detects the project's stack and recommends a hook runner (Husky / lefthook / pre-commit / native), scaffolds the runner config, and updates AGENTS.md Quality Gates. Use when the user wants to wire hooks, configure pre-commit / pre-push, set up quality gates, prevent --no-verify bypass, or close the WORKFLOW §11 advisory-vs-deterministic gap. Opt-in skill; not auto-installed.
4
+ ---
5
+
6
+ <background_information>
7
+ Scaffolds the deterministic gates `WORKFLOW.md` §11 names. The skill writes config files for a hook runner and updates `AGENTS.md` Quality Gates; it does not execute install scripts. The user runs the runner's one-time bootstrap (`npx husky init`, `lefthook install`, `pre-commit install`) — the skill names the exact command.
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 about hooks, pre-commit, or quality gates, invoke the skill manually.
10
+ </background_information>
11
+
12
+ <instructions>
13
+ Step 0 — confirm the gates the user wants. WORKFLOW §11 names two tiers:
14
+ - Pre-commit (fast): lint, format, secret-scan. Runs on every commit. Keep under ~5s; slow pre-commits push devs to `--no-verify`.
15
+ - Pre-push (thorough): build, unit tests, integration tests. Runs on every push. Acceptable to be slow.
16
+
17
+ Confirm both tiers are in scope. If the user wants only one, scaffold only that tier.
18
+
19
+ Visual / E2E for UI projects (Cypress, Playwright) live in CI, not pre-push. Out of scope.
20
+
21
+ Step 1 — detect the runner. Read repo signals in this order:
22
+ 1. Existing runner. `.husky/` → Husky. `lefthook.yml` or `.lefthook.yml` → lefthook. `.pre-commit-config.yaml` → pre-commit. `.git/hooks/` with non-sample scripts → native hooks.
23
+ 2. Stack signals (if no runner present). `package.json` → recommend Husky or lefthook. `pyproject.toml` → recommend pre-commit. `go.mod` → recommend lefthook. `Cargo.toml` → recommend lefthook. Multiple stacks → recommend lefthook (cross-language by default).
24
+ 3. No signals. Recommend native `.git/hooks/` only as fallback. Warn the user that native hooks are not portable across clones.
25
+
26
+ If multiple runners are present, surface the conflict and ask the user before scaffolding. Never silently pick.
27
+
28
+ Step 2 — recommend the per-stack commands:
29
+ - Node: lint = `npm run lint` or `npx eslint .`; format check = `npm run format:check` or `npx prettier --check .`; secret-scan = `gitleaks detect --no-banner`; build = `npm run build` (skip if no script); test = `npm test`.
30
+ - Python: lint = `ruff check .`; format check = `ruff format --check .` or `black --check .`; secret-scan = `gitleaks detect --no-banner`; test = `pytest -q`.
31
+ - Go: lint = `golangci-lint run`; format check = `gofmt -d .`; secret-scan = `gitleaks detect --no-banner`; build = `go build ./...`; test = `go test ./...`.
32
+ - Rust: lint = `cargo clippy -- -D warnings`; format check = `cargo fmt --check`; secret-scan = `gitleaks detect --no-banner`; build = `cargo build`; test = `cargo test`.
33
+ - Mixed / other: ask for the per-tier command list. Do not invent.
34
+
35
+ Offer to swap any default. Confirm before writing.
36
+
37
+ Step 3 — scaffold the runner config. Write the runner-specific config file:
38
+ - Husky: `.husky/pre-commit` and `.husky/pre-push` (shell scripts) + `"prepare": "husky"` in `package.json`. Bootstrap: `npm install`.
39
+ - lefthook: `lefthook.yml` at the repo root with `pre-commit` and `pre-push` commands keyed by stage. Bootstrap: `lefthook install`.
40
+ - pre-commit: `.pre-commit-config.yaml` with stack-specific hook references. Bootstrap: `pre-commit install` and `pre-commit install --hook-type pre-push`.
41
+ - Native: `.git/hooks/pre-commit` and `.git/hooks/pre-push` + a `setup-hooks.sh` script the user runs after every clone (since `.git/` is not committed).
42
+
43
+ Step 4 — update `AGENTS.md` Quality Gates. Append or refresh the section with: pre-commit gate list, pre-push gate list, runner name + config path, bootstrap command, CI status if known, no-bypass policy. Honor existing managed markers if `agentic-bootstrap` already wrote Quality Gates.
44
+
45
+ Step 5 — tell the user the bootstrap command. Output the exact one-line command the user runs. The skill does not execute it.
46
+ </instructions>
47
+
48
+ <output_contract>
49
+ Filesystem changes:
50
+ - The runner's config file (`.husky/pre-commit`, `lefthook.yml`, `.pre-commit-config.yaml`, or `.git/hooks/`).
51
+ - An updated `AGENTS.md` Quality Gates section.
52
+ - For native-hooks fallback: a `setup-hooks.sh` script.
53
+
54
+ The skill does not execute the runner's install command. The skill does not write CI config. The skill does not configure agent-side hooks (`.claude/settings.json`) — different surface, deferred.
55
+
56
+ Documentation discipline rules apply at write time:
57
+ - No emoji anywhere in scaffolded config or AGENTS.md update.
58
+ - No version stamps or DRAFT markers.
59
+ - Quality Gates section opens with the operational rule (gates are deterministic) before listing the gates.
60
+ - One scope: Quality Gates. No duplication of ARCHITECTURE.md or ADR rationale.
61
+ - No commented-out scripts. No orphan TODO / FIXME.
62
+ </output_contract>
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: agentic-hooks
3
+ short_description: Scaffold deterministic quality gates per WORKFLOW §11 (pre-commit / pre-push). Detect-then-recommend Husky / lefthook / pre-commit / native; never silently pick.
4
+ policy:
5
+ allow_implicit_invocation: false