skilledagent 1.0.0

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.
Files changed (72) hide show
  1. package/.agents/AGENTS.MD +44 -0
  2. package/.agents/AGENTS_README.md +125 -0
  3. package/.agents/CONTEXT.md +19 -0
  4. package/.agents/skills/ask-matt/SKILL.md +76 -0
  5. package/.agents/skills/claude-handoff/SKILL.md +18 -0
  6. package/.agents/skills/code-review/SKILL.md +89 -0
  7. package/.agents/skills/codebase-design/DEEPENING.md +37 -0
  8. package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  9. package/.agents/skills/codebase-design/SKILL.md +114 -0
  10. package/.agents/skills/design-an-interface/SKILL.md +94 -0
  11. package/.agents/skills/diagnosing-bugs/SKILL.md +134 -0
  12. package/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  13. package/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  14. package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  15. package/.agents/skills/domain-modeling/SKILL.md +74 -0
  16. package/.agents/skills/edit-article/SKILL.md +15 -0
  17. package/.agents/skills/git-guardrails-claude-code/SKILL.md +95 -0
  18. package/.agents/skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
  19. package/.agents/skills/grill-me/SKILL.md +7 -0
  20. package/.agents/skills/grill-with-docs/SKILL.md +7 -0
  21. package/.agents/skills/grilling/SKILL.md +12 -0
  22. package/.agents/skills/handoff/SKILL.md +16 -0
  23. package/.agents/skills/implement/SKILL.md +15 -0
  24. package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  25. package/.agents/skills/improve-codebase-architecture/SKILL.md +66 -0
  26. package/.agents/skills/loop-me/SKILL.md +32 -0
  27. package/.agents/skills/migrate-to-shoehorn/SKILL.md +118 -0
  28. package/.agents/skills/obsidian-vault/SKILL.md +59 -0
  29. package/.agents/skills/prototype/LOGIC.md +79 -0
  30. package/.agents/skills/prototype/SKILL.md +26 -0
  31. package/.agents/skills/prototype/UI.md +112 -0
  32. package/.agents/skills/qa/SKILL.md +130 -0
  33. package/.agents/skills/request-refactor-plan/SKILL.md +68 -0
  34. package/.agents/skills/research/SKILL.md +12 -0
  35. package/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  36. package/.agents/skills/scaffold-exercises/SKILL.md +106 -0
  37. package/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  38. package/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  39. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  40. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  41. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  42. package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  43. package/.agents/skills/setup-pre-commit/SKILL.md +91 -0
  44. package/.agents/skills/setup-ts-deep-modules/SKILL.md +102 -0
  45. package/.agents/skills/setup-ts-deep-modules/dependency-cruiser.config.cjs +95 -0
  46. package/.agents/skills/tdd/SKILL.md +36 -0
  47. package/.agents/skills/tdd/mocking.md +59 -0
  48. package/.agents/skills/tdd/tests.md +77 -0
  49. package/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  50. package/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  51. package/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  52. package/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  53. package/.agents/skills/teach/SKILL.md +140 -0
  54. package/.agents/skills/to-spec/SKILL.md +75 -0
  55. package/.agents/skills/to-tickets/SKILL.md +107 -0
  56. package/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  57. package/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  58. package/.agents/skills/triage/SKILL.md +112 -0
  59. package/.agents/skills/ubiquitous-language/SKILL.md +93 -0
  60. package/.agents/skills/wayfinder/SKILL.md +127 -0
  61. package/.agents/skills/wizard/SKILL.md +45 -0
  62. package/.agents/skills/wizard/template.sh +211 -0
  63. package/.agents/skills/writing-beats/SKILL.md +67 -0
  64. package/.agents/skills/writing-fragments/SKILL.md +79 -0
  65. package/.agents/skills/writing-great-skills/GLOSSARY.md +201 -0
  66. package/.agents/skills/writing-great-skills/SKILL.md +83 -0
  67. package/.agents/skills/writing-shape/SKILL.md +79 -0
  68. package/.agents/skills-lock.json +233 -0
  69. package/.agents/workflows/kickoff.md +211 -0
  70. package/README.md +63 -0
  71. package/bin/cli.js +24 -0
  72. package/package.json +28 -0
@@ -0,0 +1,44 @@
1
+ # Repository Architecture & Rules (`CLAUDE.md`)
2
+
3
+ ## a. How this Repo Works
4
+ - This workspace is a modular engineering environment optimized for clean backend microservices and data pipelines.
5
+ - **Directory Layout:**
6
+ - `src/`: Core application modules.
7
+ - `tests/`: Automated test suites accompanying every module.
8
+ - `.agents/` or `.claude/`: Custom behaviors, commands, and templates. **Agent Instruction:** You MUST scan both `.agents/skills/` and `.claude/skills/` recursively, detect whichever directories exist in this workspace, and load all skills and rules from them.
9
+
10
+ ## b. Skill Routing Table
11
+ - User-Initiated Orchestration: `/kickoff` workflow (Guides planning, grilling, spec creation, and implementation lifecycle; supports starting from scratch or onboarding an existing codebase via `/wayfinder`, `/code-review`, `/grilling`, `/grill-with-docs`, and `/to-spec`).
12
+ - Model-Initiated Utility Frameworks:
13
+ - Use `/to-spec` for functional system design synthesis.
14
+ - Use `/to-tickets` for backlog distribution into tracer-bullet vertical slices.
15
+ - Use `/implement` for execution (uses `/tdd` and `/code-review` internally).
16
+ - Use `/wayfinder` for planning large efforts as a shared map of investigation tickets.
17
+ - Use `/grilling` or `/grill-with-docs` for deep interview sessions.
18
+ - Use `/prototype` for throwaway prototypes to answer design questions.
19
+
20
+ ## c. Knowledge Architecture
21
+ - Core engineering truths and design patterns are maintained continuously in `CONTEXT.md`.
22
+ - Active feature backlogs are tracked via local markdown issue sheets or the repository issue management pipeline.
23
+
24
+ ## d. Project Lifecycle
25
+ - **Starting from Scratch:**
26
+ 1. Planning & Exploration (`/wayfinder` — chart the map, surface decisions)
27
+ 2. Deep Interview & Grilling (`/grilling` or `/grill-with-docs` — relentless Q&A to build shared understanding)
28
+ 3. Spec Synthesis (`/to-spec`)
29
+ 4. Task Deconstruction (`/to-tickets`)
30
+ 5. Implementation Loop (`/implement` → `/tdd` → `/code-review`)
31
+ - **Onboarding an Existing Project/Plan:**
32
+ 1. Codebase & Spec Onboarding (`/kickoff` workflow)
33
+ - Code understanding and review (`/code-review`)
34
+ - Plan / documentation ingestion and grilling (`/grill-with-docs`)
35
+ - Domain glossary extraction (`/ubiquitous-language`)
36
+ - Active gap analysis & skepticism loop with the user
37
+ - Sync decisions and rules into `CONTEXT.md`
38
+ 2. Spec Synthesis (`/to-spec`)
39
+ 3. Task & Gap Deconstruction (`/to-tickets`)
40
+ 4. Implementation Loop (`/implement` → `/tdd` → `/code-review`)
41
+
42
+ ## e. Working Rules
43
+ - Hard Rule: Never skip writing a test case before building an API routing structure.
44
+ - Hard Rule: Never mutate `CLAUDE.md`/`AGENTS.MD`/`CONTEXT.md` or the core orchestration scripts autonomously. All workflow structural updates must be keyed in directly by the user.
@@ -0,0 +1,125 @@
1
+ # ⚙️ Agentic Skeleton: Operations & Command Guide
2
+
3
+ This directory contains all required AI skills, rules, and configuration. The following guide dictates how to use this template in your project.
4
+
5
+ > [!NOTE]
6
+ > This folder is designed to bootstrap AI-assisted development. All files live inside `.agents/` so you can easily remove the template from your project at any time.
7
+
8
+ ---
9
+
10
+ ## ⚖️ The Golden Laws (What You Must Enforce)
11
+
12
+ As the Orchestrator, you must constantly hold the AI accountable to these standards. If it violates them, halt execution.
13
+
14
+ 1. **The Pedagogical Mandate:** Your goal is mastery over deep backend systems and AI/ML architectures. If the agent outputs complex logic (e.g., tensor operations, advanced concurrency, or strict Pydantic validation), force it to explain the *why* before you accept the code.
15
+ 2. **Anti-Vibe Coding:** Code is never written without a blueprint. The Red-Green-Refactor loop (`/tdd`) is absolute.
16
+ 3. **Data Rigor:** Never accept flat database schemas. Enforce BCNF normalization and robust concurrency management (avoiding reader-writer starvation).
17
+ 4. **Context Authority:** The agent is forbidden from silently changing its own rules. All updates to `.agents/CONTEXT.md` or the skills must be transparent and verified by you.
18
+
19
+ ---
20
+
21
+ ## 🚀 Scaffolding & Setup Guide
22
+
23
+ This operations guide is copied into your project's `.agents/` directory.
24
+
25
+ ### What Gets Copied
26
+ The template scaffold includes:
27
+ * **AI Skills:** Pre-configured capabilities (located in `.agents/skills/`) for standard developer tasks.
28
+ * **Workflows:** Orchestration pipelines (located in `.agents/workflows/`) that chain skills together.
29
+ * **CONTEXT.md:** Global rules, ubiquitous language, and system architecture definitions (located in `.agents/CONTEXT.md`).
30
+ * **AGENTS.MD:** Workspace mapping and skill routing tables (located in `.agents/AGENTS.MD`).
31
+ * **skills-lock.json:** Secure lockfile specifying installed capabilities (located in `.agents/skills-lock.json`).
32
+
33
+ > [!NOTE]
34
+ > The scaffold ONLY adds AI workflow and configuration files inside `.agents/`. Your project source code remains untouched, and the entire template can be cleaned up cleanly by deleting this folder.
35
+
36
+ ---
37
+
38
+ ## 🛤️ Choose Your Workflow
39
+
40
+ ### Workflow A — New Project
41
+ If starting a brand new project in an empty directory:
42
+
43
+ 1. **Initialize Directory & Git:**
44
+ ```bash
45
+ mkdir MyProject
46
+ cd MyProject
47
+ git init
48
+ ```
49
+ 2. **Scaffold the Workspace:**
50
+ ```bash
51
+ npx -y giget@latest github:AryanMotiani/agent-template/.agents .agents
52
+ ```
53
+ *(Note: Replace `AryanMotiani/agent-template` with your own repository path if you have forked or customized the template).*
54
+
55
+ ---
56
+
57
+ ### Workflow B — Existing Repository
58
+ If injecting the template into your primary project repository:
59
+
60
+ 1. **Navigate to project directory:**
61
+ ```bash
62
+ cd your-existing-project-folder
63
+ ```
64
+ 2. **Download the Template Folder:**
65
+ ```bash
66
+ npx -y giget@latest github:AryanMotiani/agent-template/.agents .agents
67
+ ```
68
+ *(Note: Replace `AryanMotiani/agent-template` with your own repository path if you have forked or customized the template. Since everything is isolated within `.agents`, it will not conflict with or overwrite any root files, like your project's `README.md` or `.gitignore`!)*
69
+
70
+ ---
71
+
72
+ ## 🔍 Verification & First Steps
73
+
74
+ ### 1. Verify Scaffolded Files
75
+ Confirm that your target project directory now contains the following:
76
+ ```text
77
+ .agents/
78
+ ├── skills/
79
+ ├── workflows/
80
+ ├── CONTEXT.md
81
+ ├── AGENTS.MD
82
+ ├── AGENTS_README.md
83
+ └── skills-lock.json
84
+ ```
85
+ *(Note: The skills are copied directly into the project and should be available to your AI agent. If they are not detected immediately, reload the workspace or restart the AI session.)*
86
+
87
+ ### 2. Initiate the Project Kickoff (`/kickoff`)
88
+ Once the folder has been scaffolded, open it in your IDE (e.g. VS Code, Cursor), and start the `/kickoff` workflow. Paste this prompt into the AI agent chat:
89
+ > "I have a new project idea: `[INSERT YOUR PROJECT IDEA/CONCEPT]`. Run the `/kickoff` workflow. Begin with the Wayfinder phase to map the project."
90
+
91
+ This launches the full orchestrated pipeline:
92
+ * **Phase 1 — Wayfinder:** Chart the decision map, explore the problem space, surface unknowns.
93
+ * **Phase 2 — Code Review (if existing code):** Analyze existing codebase against standards.
94
+ * **Phase 3 — Grilling:** Relentless Q&A to build shared understanding — no holes, no ambiguity.
95
+ * **Phase 4 — Spec Synthesis:** Generate the formal spec via `/to-spec`.
96
+ * **Phase 5 — Ticket Breakdown:** Break the spec into tracer-bullet vertical-slice tickets via `/to-tickets`.
97
+ * **Phase 6 — Implementation:** Execute tickets under TDD via `/implement`.
98
+ * **Phase 7 — Post-Implementation Review:** Final `/code-review` pass.
99
+ * **Phase 8 — Suggestions:** Ideas, problems, and improvements for the project.
100
+
101
+ ### 3. Implement Tasks under strict TDD
102
+ Once the tickets are generated, pick up the first ticket and trigger the implementation loop:
103
+ > "Let's implement ticket #1. Use `/implement` to execute it under TDD."
104
+
105
+ ---
106
+
107
+ ## 🗑️ How to Delete the Template
108
+ If you ever want to completely remove this scaffolding, its custom skills, and all AI rules from your repository, run the command for your shell:
109
+
110
+ **Linux / macOS (Bash/Zsh):**
111
+ ```bash
112
+ rm -rf .agents
113
+ ```
114
+
115
+ **Windows (PowerShell):**
116
+ ```powershell
117
+ Remove-Item -Recurse -Force .agents
118
+ ```
119
+
120
+ **Windows (CMD):**
121
+ ```cmd
122
+ rmdir /s /q .agents
123
+ ```
124
+
125
+ This leaves zero leftover files in your repository.
@@ -0,0 +1,19 @@
1
+ # Universal Engineering Context & Behavioral Guide
2
+
3
+ ## 1. System Guardrails & Execution Philosophy
4
+ - **Anti-'Vibe Coding' Policy:** The user is transitioning from basic scripting to elite systems engineering, deep backend architectures, and advanced AI/ML implementations.
5
+ - **Strict TDD:** Never write production application implementations without an accompanying failing test (Strict Red-Green-Refactor loop).
6
+ - **Pedagogical Requirement:** Do not write boilerplate code without explaining the underlying architectural design pattern (e.g., schema normalization, lock management, tensor shapes). Elevate the user's comprehension through rigorous, high-level code execution.
7
+ - **Workflow Obedience:** Always follow the sequential orchestration defined in the `/kickoff` workflow.
8
+ - **Rules Detection:** Scan both `.agents/` and `.claude/` directories recursively to detect and execute all skills, custom command instructions, and configuration settings present in this workspace.
9
+
10
+ ## 2. Architectural Discipline & Alignment
11
+ - **ADR Mandate:** Any major deviation from the initial spec requires a new Architecture Decision Record (ADR) before implementation.
12
+ - **Alignment Protocol:** When starting a new feature, prioritize rigorous data isolation and robust concurrency management.
13
+ - **Dynamic Stack Injection:** Exact project specifications will be injected dynamically during the `/kickoff` alignment phase.
14
+
15
+ ## 3. Technical Standards (To Be Populated During Project Kickoff)
16
+ - *(Agent: Actively populate this section during the /kickoff workflow interview or spec onboarding with the target languages, frameworks, testing libraries, and architectural conventions selected for the project. For example: Node.js/TypeScript, PostgreSQL, NestJS, Jest, etc. Enforce these strictly as the absolute engineering baseline.)*
17
+
18
+ ## 4. Ubiquitous Language (Domain Dictionary)
19
+ - *(Agent: Actively populate this section during the /kickoff workflow interview with domain-specific terminology, business logic definitions, and common words to ensure ubiquitous language across all agentic skills).*
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: ask-matt
3
+ description: Ask which skill or flow fits your situation. A router over the skills in this repo.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Ask Matt
8
+
9
+ You don't remember every skill, so ask.
10
+
11
+ A **flow** is a path through the skills. Most paths run along one **main flow**, and two **on-ramps** merge onto it. Everything else is standalone, or a vocabulary layer that runs underneath.
12
+
13
+ ## The main flow: idea → ship
14
+
15
+ The route most work travels. You have an idea and want it built.
16
+
17
+ 1. **`/grill-with-docs`** — sharpen the idea by interview. Start here when you **have a codebase**: it's stateful, retaining what it learns in `CONTEXT.md` and ADRs. (No codebase? Use `/grill-me` — see Standalone. Both run the same `/grilling` primitive; `grill-with-docs` is the one that leaves a paper trail.)
18
+ 2. **Branch — can you settle every question in conversation?** If a question needs a runnable answer (state, business logic, a UI you have to see), detour through a prototype, bridged by **`/handoff`** in both directions (see Crossing sessions):
19
+ - **`/handoff`** out, then open a fresh session against that file,
20
+ - **`/prototype`** to answer the question with throwaway code,
21
+ - **`/handoff`** back what you learned, and reference it from the original idea thread.
22
+ 3. **Branch — is this a multi-session build?**
23
+ - **Yes** → **`/to-spec`** (turn the thread into a spec), then **`/to-tickets`** to split it into tracer-bullet tickets, each declaring its **blocking edges**. On a local tracker that's one file per ticket under `.scratch/<feature>/issues/`, worked blockers-first by hand; on a real tracker the edges become native blocking links, so any ticket whose blockers are done can be grabbed — kick off **`/implement`** per ticket, **clearing context between each one**.
24
+ - **No** → **`/implement`** right here, in the same context window.
25
+
26
+ Either way, **`/implement`** builds each issue by driving **`/tdd`** internally — one red-green slice at a time — then closes out by running **`/code-review`**, a two-axis review (Standards + Spec) of the diff, before committing. Reach for **`/tdd`** on its own when you just want to build a concrete behaviour test-first without a full spec, and **`/code-review`** on its own whenever you want to review a branch or PR against a fixed point.
27
+
28
+ ### Context hygiene
29
+
30
+ Keep steps 1–3 in **one unbroken context window** — don't compact or clear until after `/to-tickets` — so the grilling, spec, and tickets all build on the same thinking. Each `/implement` then starts fresh, working from the ticket.
31
+
32
+ The limit on this is the **[smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone)**: the window (~120k tokens on state-of-the-art models) within which the model still reasons sharply. If a session approaches it before `/to-tickets`, don't push on degraded — `/handoff` and continue in a fresh thread.
33
+
34
+ ## On-ramps
35
+
36
+ A starting situation that generates work, then merges onto the main flow.
37
+
38
+ - **Bugs and requests piling up** → **`/triage`**. It moves issues through triage roles and produces agent-ready issues, which **`/implement`** later picks up.
39
+
40
+ Triage is only for issues **you didn't create** — bug reports, incoming feature requests, anything that arrives raw. Tickets that `/to-tickets` produced are already agent-ready, so **don't triage them**.
41
+
42
+ - **Something's broken** → **`/diagnosing-bugs`**. For the hard ones: the bug that resists a first glance, the intermittent flake, the regression that crept in between two known-good states. It refuses to theorise until it has a **tight feedback loop** — one command that already goes red on *this* bug — then fixes with a regression test. Its post-mortem hands off to **`/improve-codebase-architecture`** when the real finding is that there's no good seam to lock the bug down.
43
+
44
+ - **A huge, foggy effort — a greenfield project or a huge feature build, too big for one session** → **`/wayfinder`**. When the way from here to the destination isn't visible yet, it charts a **shared map** of investigation tickets on the issue tracker and resolves them one at a time — producing **decisions, not deliverables** — until the fog is pushed back and the way is clear. Then it merges onto the main flow at **`/to-spec`** (or, if the effort turned out small enough, straight to **`/implement`**). Where **`/grill-with-docs`** sharpens an idea you can hold in one session, wayfinder is for the idea you can't.
45
+
46
+ ## Codebase health
47
+
48
+ Not feature work — upkeep.
49
+
50
+ - **`/improve-codebase-architecture`** — run whenever you have a spare moment to keep the codebase good for agents to operate in. It surfaces **deepening opportunities**; picking one _generates an idea_ you can take into the main flow at `/grill-with-docs`. It's the survey that finds the candidates; **`/codebase-design`** (below) is the bench you design the chosen one on.
51
+
52
+ ## Vocabulary underneath
53
+
54
+ Two model-invoked references that run *beneath* the other skills — each the single source of truth for its vocabulary. Reach for them directly when the **words**, not the process, are the problem; or let the skills above pull them in.
55
+
56
+ - **`/domain-modeling`** — sharpen the project's *domain* language: challenge a fuzzy term, resolve an overloaded word ("account" doing three jobs), record a hard-to-reverse decision as an ADR. It's the active discipline `/grill-with-docs` drives to keep `CONTEXT.md` a clean glossary.
57
+ - **`/codebase-design`** — the deep-module vocabulary (module, interface, depth, seam, adapter, leverage, locality) for designing a module's *shape*: a lot of behaviour behind a small interface at a clean seam. `/tdd` and `/improve-codebase-architecture` both speak it.
58
+
59
+ ## Crossing sessions
60
+
61
+ - **`/handoff`** — when a thread is full or you need to branch off (e.g. into a `/prototype` session), this compacts the conversation into a markdown file. You don't continue in place — you **open a new session and reference that file** to carry the context across. It's the bridge between context windows, in either direction. Use it when you want a **fresh session** but need the **current conversation preserved**.
62
+ - **`/compact`** (built-in) — stay in the **same conversation**, letting the earlier turns be summarized. Use it at **intentional breaks between phases**, when you don't mind losing the verbatim history. Don't compact mid-phase — the agent can lose its way. `/handoff` forks; `/compact` continues.
63
+
64
+ ## Standalone
65
+
66
+ Off the main flow entirely.
67
+
68
+ - **`/grill-me`** — the same relentless interview as `/grill-with-docs`, but for when you have **no codebase**. Stateless: it saves nothing locally, builds no `CONTEXT.md`. Reach for it to sharpen any plan or design that doesn't live in a repo.
69
+ - **`/prototype`** — a small, throwaway program that answers one design question: does this state model feel right, or what should this UI look like. Throwaway from day one — keep the answer, delete the code. It's the detour in step 2 of the main flow, but reach for it any time a design question is hard to settle on paper.
70
+ - **`/research`** — delegate reading legwork to a **background agent**: it investigates a question against **primary sources**, then leaves a cited Markdown file in the repo. Keep working while it reads. The file it produces is something to take *into* the main flow at `/grill-with-docs` — research feeds the thinking, it doesn't replace it.
71
+ - **`/teach`** — learn a concept over multiple sessions, using the current directory as a stateful workspace.
72
+ - **`/writing-great-skills`** — reference for writing and editing skills well.
73
+
74
+ ## Precondition
75
+
76
+ **`/setup-matt-pocock-skills`** — run before your first engineering flow to configure the issue tracker, triage labels, and doc layout the other skills assume. Custom issue trackers also work.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: claude-handoff
3
+ description: Hand the current conversation off to a fresh background agent that picks up the work immediately.
4
+ argument-hint: "What will the next session be used for?"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ Write a handoff summary of the current conversation so a fresh agent can continue the work. Instead of saving it, launch a background agent seeded with the summary as its prompt: `claude --bg --name "<descriptive name>" "<handoff summary>"`. It starts in the current working directory and returns immediately; the user manages it with `claude agents`.
9
+
10
+ Always pass `-n`/`--name` with a descriptive name (e.g. `--name "Fix login bug"`) — it sets the display name shown in the job list, session picker, and terminal title.
11
+
12
+ Include a "suggested skills" section in the summary, which suggests skills that the agent should invoke.
13
+
14
+ Do not duplicate content already captured in other artifacts (PRDs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead.
15
+
16
+ Redact any sensitive information, such as API keys, passwords, or personally identifiable information — the summary becomes the agent's prompt.
17
+
18
+ If the user passed arguments, treat them as a description of what the next session will focus on and tailor the summary accordingly.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: code-review
3
+ description: Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".
4
+ ---
5
+
6
+ Two-axis review of the diff between `HEAD` and a fixed point the user supplies:
7
+
8
+ - **Standards** — does the code conform to this repo's documented coding standards?
9
+ - **Spec** — does the code faithfully implement the originating issue / PRD / spec?
10
+
11
+ Both axes run as **parallel sub-agents** so they don't pollute each other's context, then this skill aggregates their findings.
12
+
13
+ The issue tracker should have been provided to you — run `/setup-matt-pocock-skills` if `docs/agents/issue-tracker.md` is missing.
14
+
15
+ ## Process
16
+
17
+ ### 1. Pin the fixed point
18
+
19
+ Whatever the user said is the fixed point — a commit SHA, branch name, tag, `main`, `HEAD~5`, etc. If they didn't specify one, ask for it.
20
+
21
+ Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.
22
+
23
+ Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here — not inside two parallel sub-agents.
24
+
25
+ ### 2. Identify the spec source
26
+
27
+ Look for the originating spec, in this order:
28
+
29
+ 1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.) — fetch via the workflow in `docs/agents/issue-tracker.md`.
30
+ 2. A path the user passed as an argument.
31
+ 3. A PRD/spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.
32
+ 4. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".
33
+
34
+ ### 3. Identify the standards sources
35
+
36
+ Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
37
+
38
+ On top of whatever the repo documents, the Standards axis always carries the **smell baseline** below — a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Two rules bind it:
39
+
40
+ - **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
41
+ - **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.
42
+
43
+ Each smell reads *what it is* → *how to fix*; match it against the diff:
44
+
45
+ - **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
46
+ - **Duplicated Code** — the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
47
+ - **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies.
48
+ - **Data Clumps** — the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
49
+ - **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
50
+ - **Repeated Switches** — the same `switch`/`if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
51
+ - **Shotgun Surgery** — one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
52
+ - **Divergent Change** — one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
53
+ - **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
54
+ - **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
55
+ - **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct.
56
+ - **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
57
+
58
+ ### 4. Spawn both sub-agents in parallel
59
+
60
+ Send a single message with two `Agent` tool calls. Use the `general-purpose` subagent for both.
61
+
62
+ **Standards sub-agent prompt** — include:
63
+
64
+ - The full diff command and commit list.
65
+ - The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full — the sub-agent has no other access to it.
66
+ - The brief: "Report — per file/hunk where relevant — (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls — documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
67
+
68
+ **Spec sub-agent prompt** — include:
69
+
70
+ - The diff command and commit list.
71
+ - The path or fetched contents of the spec.
72
+ - The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
73
+
74
+ If the spec is missing, skip the Spec sub-agent and note this in the final report.
75
+
76
+ ### 5. Aggregate
77
+
78
+ Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings — the two axes are deliberately separate (see _Why two axes_).
79
+
80
+ End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes — that's the reranking the separation exists to prevent.
81
+
82
+ ## Why two axes
83
+
84
+ A change can pass one axis and fail the other:
85
+
86
+ - Code that follows every standard but implements the wrong thing → **Standards pass, Spec fail.**
87
+ - Code that does exactly what the issue asked but breaks the project's conventions → **Spec pass, Standards fail.**
88
+
89
+ Reporting them separately stops one axis from masking the other.
@@ -0,0 +1,37 @@
1
+ # Deepening
2
+
3
+ How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [SKILL.md](SKILL.md) — **module**, **interface**, **seam**, **adapter**.
4
+
5
+ ## Dependency categories
6
+
7
+ When assessing a candidate for deepening, classify its dependencies. The category determines how the deepened module is tested across its seam.
8
+
9
+ ### 1. In-process
10
+
11
+ Pure computation, in-memory state, no I/O. Always deepenable — merge the modules and test through the new interface directly. No adapter needed.
12
+
13
+ ### 2. Local-substitutable
14
+
15
+ Dependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface.
16
+
17
+ ### 3. Remote but owned (Ports & Adapters)
18
+
19
+ Your own services across a network boundary (microservices, internal APIs). Define a **port** (interface) at the seam. The deep module owns the logic; the transport is injected as an **adapter**. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter.
20
+
21
+ Recommendation shape: *"Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network."*
22
+
23
+ ### 4. True external (Mock)
24
+
25
+ Third-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter.
26
+
27
+ ## Seam discipline
28
+
29
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a port unless at least two adapters are justified (typically production + test). A single-adapter seam is just indirection.
30
+ - **Internal seams vs external seams.** A deep module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface. Don't expose internal seams through the interface just because tests use them.
31
+
32
+ ## Testing strategy: replace, don't layer
33
+
34
+ - Old unit tests on shallow modules become waste once tests at the deepened module's interface exist — delete them.
35
+ - Write new tests at the deepened module's interface. The **interface is the test surface**.
36
+ - Tests assert on observable outcomes through the interface, not internal state.
37
+ - Tests should survive internal refactors — they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface.
@@ -0,0 +1,44 @@
1
+ # Design It Twice
2
+
3
+ When the user wants to explore alternative interfaces for a chosen deepening candidate, use this parallel sub-agent pattern. Based on "Design It Twice" (Ousterhout) — your first idea is unlikely to be the best.
4
+
5
+ Uses the vocabulary in [SKILL.md](SKILL.md) — **module**, **interface**, **seam**, **adapter**, **leverage**.
6
+
7
+ ## Process
8
+
9
+ ### 1. Frame the problem space
10
+
11
+ Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:
12
+
13
+ - The constraints any new interface would need to satisfy
14
+ - The dependencies it would rely on, and which category they fall into (see [DEEPENING.md](DEEPENING.md))
15
+ - A rough illustrative code sketch to ground the constraints — not a proposal, just a way to make the constraints concrete
16
+
17
+ Show this to the user, then immediately proceed to Step 2. The user reads and thinks while the sub-agents work in parallel.
18
+
19
+ ### 2. Spawn sub-agents
20
+
21
+ Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a **radically different** interface for the deepened module.
22
+
23
+ Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint:
24
+
25
+ - Agent 1: "Minimize the interface — aim for 1–3 entry points max. Maximise leverage per entry point."
26
+ - Agent 2: "Maximise flexibility — support many use cases and extension."
27
+ - Agent 3: "Optimise for the most common caller — make the default case trivial."
28
+ - Agent 4 (if applicable): "Design around ports & adapters for cross-seam dependencies."
29
+
30
+ Include both [SKILL.md](SKILL.md) vocabulary and CONTEXT.md vocabulary in the brief so each sub-agent names things consistently with the architecture language and the project's domain language.
31
+
32
+ Each sub-agent outputs:
33
+
34
+ 1. Interface (types, methods, params — plus invariants, ordering, error modes)
35
+ 2. Usage example showing how callers use it
36
+ 3. What the implementation hides behind the seam
37
+ 4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md))
38
+ 5. Trade-offs — where leverage is high, where it's thin
39
+
40
+ ### 3. Present and compare
41
+
42
+ Present designs sequentially so the user can absorb each one, then compare them in prose. Contrast by **depth** (leverage at the interface), **locality** (where change concentrates), and **seam placement**.
43
+
44
+ After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated — the user wants a strong read, not a menu.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: codebase-design
3
+ description: Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
4
+ ---
5
+
6
+ # Codebase Design
7
+
8
+ Design **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.
9
+
10
+ ## Glossary
11
+
12
+ Use these terms exactly — don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point.
13
+
14
+ **Module** — anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. _Avoid_: unit, component, service.
15
+
16
+ **Interface** — everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. _Avoid_: API, signature (too narrow — they refer only to the type-level surface).
17
+
18
+ **Implementation** — what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for "adapter" when the seam is the topic; "implementation" otherwise.
19
+
20
+ **Depth** — leverage at the interface: the amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.
21
+
22
+ **Seam** _(Michael Feathers)_ — a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).
23
+
24
+ **Adapter** — a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).
25
+
26
+ **Leverage** — what callers get from depth: more capability per unit of interface they learn. One implementation pays back across N call sites and M tests.
27
+
28
+ **Locality** — what maintainers get from depth: change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.
29
+
30
+ ## Deep vs shallow
31
+
32
+ **Deep module** = small interface + lots of implementation:
33
+
34
+ ```
35
+ ┌─────────────────────┐
36
+ │ Small Interface │ ← Few methods, simple params
37
+ ├─────────────────────┤
38
+ │ │
39
+ │ Deep Implementation│ ← Complex logic hidden
40
+ │ │
41
+ └─────────────────────┘
42
+ ```
43
+
44
+ **Shallow module** = large interface + little implementation (avoid):
45
+
46
+ ```
47
+ ┌─────────────────────────────────┐
48
+ │ Large Interface │ ← Many methods, complex params
49
+ ├─────────────────────────────────┤
50
+ │ Thin Implementation │ ← Just passes through
51
+ └─────────────────────────────────┘
52
+ ```
53
+
54
+ When designing an interface, ask:
55
+
56
+ - Can I reduce the number of methods?
57
+ - Can I simplify the parameters?
58
+ - Can I hide more complexity inside?
59
+
60
+ ## Principles
61
+
62
+ - **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts — they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.
63
+ - **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
64
+ - **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.
65
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.
66
+
67
+ ## Designing for testability
68
+
69
+ Good interfaces make testing natural:
70
+
71
+ 1. **Accept dependencies, don't create them.**
72
+
73
+ ```typescript
74
+ // Testable
75
+ function processOrder(order, paymentGateway) {}
76
+
77
+ // Hard to test
78
+ function processOrder(order) {
79
+ const gateway = new StripeGateway();
80
+ }
81
+ ```
82
+
83
+ 2. **Return results, don't produce side effects.**
84
+
85
+ ```typescript
86
+ // Testable
87
+ function calculateDiscount(cart): Discount {}
88
+
89
+ // Hard to test
90
+ function applyDiscount(cart): void {
91
+ cart.total -= discount;
92
+ }
93
+ ```
94
+
95
+ 3. **Small surface area.** Fewer methods = fewer tests needed. Fewer params = simpler test setup.
96
+
97
+ ## Relationships
98
+
99
+ - A **Module** has exactly one **Interface** (the surface it presents to callers and tests).
100
+ - **Depth** is a property of a **Module**, measured against its **Interface**.
101
+ - A **Seam** is where a **Module**'s **Interface** lives.
102
+ - An **Adapter** sits at a **Seam** and satisfies the **Interface**.
103
+ - **Depth** produces **Leverage** for callers and **Locality** for maintainers.
104
+
105
+ ## Rejected framings
106
+
107
+ - **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.
108
+ - **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow — interface here includes every fact a caller must know.
109
+ - **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.
110
+
111
+ ## Going deeper
112
+
113
+ - **Deepening a cluster given its dependencies** — see [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, and replace-don't-layer testing.
114
+ - **Exploring alternative interfaces** — see [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): spin up parallel sub-agents to design the interface several radically different ways, then compare on depth, locality, and seam placement.