@ecology91/skills 0.1.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.
- package/LICENSE +21 -0
- package/README.md +179 -0
- package/bin/install.mjs +52 -0
- package/opencode.json +10 -0
- package/package.json +37 -0
- package/scripts/link-skills.sh +40 -0
- package/scripts/list-skills.sh +7 -0
- package/skills/engineering/README.md +16 -0
- package/skills/engineering/diagnose/SKILL.md +117 -0
- package/skills/engineering/diagnose/scripts/hitl-loop.template.sh +41 -0
- package/skills/engineering/grill-with-docs/ADR-FORMAT.md +47 -0
- package/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +77 -0
- package/skills/engineering/grill-with-docs/SKILL.md +88 -0
- package/skills/engineering/improve-codebase-architecture/DEEPENING.md +37 -0
- package/skills/engineering/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
- package/skills/engineering/improve-codebase-architecture/LANGUAGE.md +53 -0
- package/skills/engineering/improve-codebase-architecture/SKILL.md +71 -0
- package/skills/engineering/prototype/LOGIC.md +79 -0
- package/skills/engineering/prototype/SKILL.md +30 -0
- package/skills/engineering/prototype/UI.md +112 -0
- package/skills/engineering/setup-agent-skills/SKILL.md +128 -0
- package/skills/engineering/setup-agent-skills/domain.md +51 -0
- package/skills/engineering/setup-agent-skills/issue-tracker-beads.md +54 -0
- package/skills/engineering/setup-agent-skills/issue-tracker-github.md +33 -0
- package/skills/engineering/setup-agent-skills/issue-tracker-gitlab.md +34 -0
- package/skills/engineering/setup-agent-skills/issue-tracker-local.md +27 -0
- package/skills/engineering/setup-agent-skills/triage-labels.md +15 -0
- package/skills/engineering/setup-coding-quality-checks/SKILL.md +84 -0
- package/skills/engineering/tdd/SKILL.md +109 -0
- package/skills/engineering/tdd/deep-modules.md +33 -0
- package/skills/engineering/tdd/interface-design.md +31 -0
- package/skills/engineering/tdd/mocking.md +59 -0
- package/skills/engineering/tdd/refactoring.md +10 -0
- package/skills/engineering/tdd/tests.md +61 -0
- package/skills/engineering/to-issues/SKILL.md +99 -0
- package/skills/engineering/to-prd/SKILL.md +76 -0
- package/skills/engineering/to-qa/SKILL.md +45 -0
- package/skills/engineering/triage/AGENT-BRIEF.md +186 -0
- package/skills/engineering/triage/OUT-OF-SCOPE.md +101 -0
- package/skills/engineering/triage/SKILL.md +107 -0
- package/skills/engineering/zoom-out/SKILL.md +7 -0
- package/skills/misc/README.md +8 -0
- package/skills/misc/git-guardrails-opencode/SKILL.md +57 -0
- package/skills/misc/migrate-to-shoehorn/SKILL.md +118 -0
- package/skills/misc/scaffold-exercises/SKILL.md +106 -0
- package/skills/misc/setup-pre-commit/SKILL.md +91 -0
- package/skills/productivity/README.md +8 -0
- package/skills/productivity/caveman/SKILL.md +49 -0
- package/skills/productivity/grill-me/SKILL.md +10 -0
- package/skills/productivity/handoff/SKILL.md +13 -0
- package/skills/productivity/write-a-skill/SKILL.md +117 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-agent-skills
|
|
3
|
+
description: Sets up an `## Agent skills` block in AGENTS.md and `docs/agents/` so the engineering skills know this repo's issue tracker (GitHub, GitLab, Beads, local markdown, or custom), triage label vocabulary, and domain doc layout. Run before first use of `to-issues`, `to-prd`, `to-qa`, `triage`, `diagnose`, `tdd`, `improve-codebase-architecture`, or `zoom-out` — or if those skills appear to be missing context about the issue tracker, triage labels, or domain docs.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Setup Agent Skills
|
|
8
|
+
|
|
9
|
+
Scaffold the per-repo configuration that the engineering skills assume:
|
|
10
|
+
|
|
11
|
+
- **Issue tracker** — where issues live (GitHub, GitLab, Beads, local markdown, and custom workflows are supported)
|
|
12
|
+
- **Triage labels** — the strings used for the five canonical triage roles
|
|
13
|
+
- **Domain docs** — where `CONTEXT.md` and ADRs live, and the consumer rules for reading them
|
|
14
|
+
|
|
15
|
+
This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
### 1. Explore
|
|
20
|
+
|
|
21
|
+
Look at the current repo to understand its starting state. Read whatever exists; don't assume:
|
|
22
|
+
|
|
23
|
+
- `git remote -v` and `.git/config` — is this a GitHub repo? Which one?
|
|
24
|
+
- `.beads/` — is Beads already initialized for local issue tracking?
|
|
25
|
+
- `bd --help` or `command -v bd` — is the Beads CLI available?
|
|
26
|
+
- `.sandcastle/` — does existing Sandcastle prompt/config scaffolding mention Beads commands such as `bd ready --json`?
|
|
27
|
+
- If `.sandcastle/` exists, inspect prompts for stale RALPH anti-patterns: planner analyzing dependencies from `bd ready`, implementer saying "fill your context window", implementer preloading full recent commits, implementer fetching issue context itself instead of using provided task context, merge prompt running tests after each branch, or merge prompt closing all listed issues instead of only merge-eligible issues.
|
|
28
|
+
- `AGENTS.md` at the repo root — does it exist? Is there already an `## Agent skills` section?
|
|
29
|
+
- `CONTEXT.md` and `CONTEXT-MAP.md` at the repo root
|
|
30
|
+
- `docs/adr/` and any `src/*/docs/adr/` directories
|
|
31
|
+
- `docs/agents/` — does this skill's prior output already exist?
|
|
32
|
+
- `.scratch/` — sign that a local-markdown issue tracker convention is already in use
|
|
33
|
+
|
|
34
|
+
### 2. Present findings and ask
|
|
35
|
+
|
|
36
|
+
Summarise what's present and what's missing. Then walk the user through the three decisions **one at a time** — present a section, get the user's answer, then move to the next. Don't dump all three at once.
|
|
37
|
+
|
|
38
|
+
Assume the user does not know what these terms mean. Each section starts with a short explainer (what it is, why these skills need it, what changes if they pick differently). Then show the choices and the default.
|
|
39
|
+
|
|
40
|
+
**Section A — Issue tracker.**
|
|
41
|
+
|
|
42
|
+
> Explainer: The "issue tracker" is where issues live for this repo. Skills like `to-issues`, `triage`, and `to-prd` read from and write to it. `/to-qa` reads parent and completed child work from it, then writes QA checks to QA To Do instead of mutating tracker issues. Pick the place you actually track work for this repo.
|
|
43
|
+
|
|
44
|
+
Default posture: these skills were designed for GitHub and Beads/Sandcastle workflows. If a `git remote` points at GitHub, propose GitHub. If a `git remote` points at GitLab (`gitlab.com` or a self-hosted host), propose GitLab. If `.beads/` exists or Sandcastle/RALPH conventions are present, propose Beads. Otherwise (or if the user prefers), offer:
|
|
45
|
+
|
|
46
|
+
- **GitHub** — issues live in the repo's GitHub Issues (uses the `gh` CLI)
|
|
47
|
+
- **GitLab** — issues live in the repo's GitLab Issues (uses the [`glab`](https://gitlab.com/gitlab-org/cli) CLI)
|
|
48
|
+
- **Beads** — issues live in `.beads/` and are managed with the `bd` CLI; this is the most explicit option for Sandcastle/RALPH parent-child issue workflows
|
|
49
|
+
- **Local markdown** — issues live as files under `.scratch/<feature>/` in this repo (good for solo projects or repos without a remote)
|
|
50
|
+
- **Other** (Jira, Linear, etc.) — ask the user to describe the workflow in one paragraph; the skill will record it as freeform prose
|
|
51
|
+
|
|
52
|
+
For `/to-qa`, make sure the chosen issue tracker documentation explains how to fetch completed child work for a parent issue. Beads and local markdown templates include this by default. GitHub, GitLab, and custom trackers need a repo-specific parent/child convention if the user wants `/to-qa` to work there.
|
|
53
|
+
|
|
54
|
+
If stale `.sandcastle/` prompt anti-patterns are present, warn that RALPH prompts should be updated before running autonomous work. Current Sandcastle loops should pass compact `bd ready` output to the planner, load task context once before implementer launch, use completion signals for merge eligibility, and run verification at the right level rather than repeatedly per branch.
|
|
55
|
+
|
|
56
|
+
**Section B — Triage label vocabulary.**
|
|
57
|
+
|
|
58
|
+
> Explainer: When the `triage` skill processes an incoming issue, it moves it through a state machine — needs evaluation, waiting on reporter, ready for an AFK agent to pick up, ready for a human, or won't fix. To do that, it needs to apply labels (or the equivalent in your issue tracker) that match strings *you've actually configured*. If your repo already uses different label names (e.g. `bug:triage` instead of `needs-triage`), map them here so the skill applies the right ones instead of creating duplicates.
|
|
59
|
+
|
|
60
|
+
The five canonical roles:
|
|
61
|
+
|
|
62
|
+
- `needs-triage` — maintainer needs to evaluate
|
|
63
|
+
- `needs-info` — waiting on reporter
|
|
64
|
+
- `ready-for-agent` — fully specified, AFK-ready (an agent can pick it up with no human context)
|
|
65
|
+
- `ready-for-human` — needs human implementation
|
|
66
|
+
- `wontfix` — will not be actioned
|
|
67
|
+
|
|
68
|
+
Default: each role's string equals its name. Ask the user if they want to override any. If their issue tracker has no existing labels, the defaults are fine.
|
|
69
|
+
|
|
70
|
+
**Section C — Domain docs.**
|
|
71
|
+
|
|
72
|
+
> Explainer: Some skills (`improve-codebase-architecture`, `diagnose`, `tdd`) read a `CONTEXT.md` file to learn the project's domain language, and `docs/adr/` for past architectural decisions. They need to know whether the repo has one global context or multiple (e.g. a monorepo with separate frontend/backend contexts) so they look in the right place.
|
|
73
|
+
|
|
74
|
+
Confirm the layout:
|
|
75
|
+
|
|
76
|
+
- **Single-context** — one `CONTEXT.md` + `docs/adr/` at the repo root. Most repos are this.
|
|
77
|
+
- **Multi-context** — `CONTEXT-MAP.md` at the root pointing to per-context `CONTEXT.md` files (typically a monorepo).
|
|
78
|
+
|
|
79
|
+
### 3. Confirm and edit
|
|
80
|
+
|
|
81
|
+
Show the user a draft of:
|
|
82
|
+
|
|
83
|
+
- The `## Agent skills` block to add to `AGENTS.md`
|
|
84
|
+
- The contents of `docs/agents/issue-tracker.md`, `docs/agents/triage-labels.md`, `docs/agents/domain.md`
|
|
85
|
+
|
|
86
|
+
Let them edit before writing.
|
|
87
|
+
|
|
88
|
+
### 4. Write
|
|
89
|
+
|
|
90
|
+
**Pick the file to edit:**
|
|
91
|
+
|
|
92
|
+
- If `AGENTS.md` exists, edit it.
|
|
93
|
+
- If it does not exist, create `AGENTS.md`.
|
|
94
|
+
|
|
95
|
+
If an `## Agent skills` block already exists in the chosen file, update its contents in-place rather than appending a duplicate. Don't overwrite user edits to the surrounding sections.
|
|
96
|
+
|
|
97
|
+
The block:
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
## Agent skills
|
|
101
|
+
|
|
102
|
+
### Issue tracker
|
|
103
|
+
|
|
104
|
+
[one-line summary of where issues are tracked]. See `docs/agents/issue-tracker.md`.
|
|
105
|
+
|
|
106
|
+
### Triage labels
|
|
107
|
+
|
|
108
|
+
[one-line summary of the label vocabulary]. See `docs/agents/triage-labels.md`.
|
|
109
|
+
|
|
110
|
+
### Domain docs
|
|
111
|
+
|
|
112
|
+
[one-line summary of layout — "single-context" or "multi-context"]. See `docs/agents/domain.md`.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Then write the three docs files using the seed templates in this skill folder as a starting point:
|
|
116
|
+
|
|
117
|
+
- [issue-tracker-github.md](./issue-tracker-github.md) — GitHub issue tracker
|
|
118
|
+
- [issue-tracker-gitlab.md](./issue-tracker-gitlab.md) — GitLab issue tracker
|
|
119
|
+
- [issue-tracker-beads.md](./issue-tracker-beads.md) — Beads issue tracker
|
|
120
|
+
- [issue-tracker-local.md](./issue-tracker-local.md) — local-markdown issue tracker
|
|
121
|
+
- [triage-labels.md](./triage-labels.md) — label mapping
|
|
122
|
+
- [domain.md](./domain.md) — domain doc consumer rules + layout
|
|
123
|
+
|
|
124
|
+
For "other" issue trackers, write `docs/agents/issue-tracker.md` from scratch using the user's description.
|
|
125
|
+
|
|
126
|
+
### 5. Done
|
|
127
|
+
|
|
128
|
+
Tell the user the setup is complete and which engineering skills will now read from these files. Mention they can edit `docs/agents/*.md` directly later — re-running this skill is only necessary if they want to switch issue trackers or restart from scratch.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Domain Docs
|
|
2
|
+
|
|
3
|
+
How the engineering skills should consume this repo's domain documentation when exploring the codebase.
|
|
4
|
+
|
|
5
|
+
## Before exploring, read these
|
|
6
|
+
|
|
7
|
+
- **`CONTEXT.md`** at the repo root, or
|
|
8
|
+
- **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
|
|
9
|
+
- **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
|
|
10
|
+
|
|
11
|
+
If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The producer skill (`/grill-with-docs`) creates them lazily when terms or decisions actually get resolved.
|
|
12
|
+
|
|
13
|
+
## File structure
|
|
14
|
+
|
|
15
|
+
Single-context repo (most repos):
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
/
|
|
19
|
+
├── CONTEXT.md
|
|
20
|
+
├── docs/adr/
|
|
21
|
+
│ ├── 0001-event-sourced-orders.md
|
|
22
|
+
│ └── 0002-postgres-for-write-model.md
|
|
23
|
+
└── src/
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Multi-context repo (presence of `CONTEXT-MAP.md` at the root):
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
/
|
|
30
|
+
├── CONTEXT-MAP.md
|
|
31
|
+
├── docs/adr/ ← system-wide decisions
|
|
32
|
+
└── src/
|
|
33
|
+
├── ordering/
|
|
34
|
+
│ ├── CONTEXT.md
|
|
35
|
+
│ └── docs/adr/ ← context-specific decisions
|
|
36
|
+
└── billing/
|
|
37
|
+
├── CONTEXT.md
|
|
38
|
+
└── docs/adr/
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Use the glossary's vocabulary
|
|
42
|
+
|
|
43
|
+
When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
|
|
44
|
+
|
|
45
|
+
If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/grill-with-docs`).
|
|
46
|
+
|
|
47
|
+
## Flag ADR conflicts
|
|
48
|
+
|
|
49
|
+
If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
|
|
50
|
+
|
|
51
|
+
> _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Issue tracker: Beads
|
|
2
|
+
|
|
3
|
+
Issues and PRDs for this repo live in `.beads/`. Use the `bd` CLI for all operations. `.beads/` must be committed/tracked in git for opencode/Sandcastle worktree sandboxes to see it; untracked local Beads state will not appear in worktrees.
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- **Issue IDs**: Beads IDs are strings like `bd-a1b2` or hierarchical IDs, never numeric issue numbers. If another skill says `#42`, issue number, or numeric issue reference, use the Beads string ID instead; if only a number is supplied, ask for or search for the Beads ID.
|
|
8
|
+
- **Create an issue**: `bd create "Title" --body-file - -t task -p 2 -l needs-triage --json`. Pipe multiline bodies through stdin or a body file, for example `bd create "Title" --body-file - -t task -p 2 -l needs-triage --json < body.md`. `--stdin` is an alias for `--body-file -`.
|
|
9
|
+
- **Create a child issue**: `bd create "Title" --body-file - --parent <parent-id> -t task -p 2 -l ready-for-agent --json`.
|
|
10
|
+
- **Create a human-gated child issue**: `bd create "Title" --body-file - --parent <parent-id> -t task -p 2 -l ready-for-human --json`.
|
|
11
|
+
- **Issue type**: `-t, --type` accepts `bug|feature|task|epic|chore|decision`; default is `task`.
|
|
12
|
+
- **Priority**: `-p 2` is Beads' default medium priority. `0` / `P0` is highest; `4` / `P4` is lowest. Sandcastle uses `bd ready --json` for actionable work and does not parse priority itself.
|
|
13
|
+
- **Labels**: `-l, --labels` accepts comma-separated labels, for example `-l needs-triage,bug`.
|
|
14
|
+
- **Read an issue**: `bd show <ID> --json` and `bd comments <ID> --json`.
|
|
15
|
+
- **List actionable work**: `bd ready --json` returns unblocked work that is ready to pick up.
|
|
16
|
+
- **Query children for QA**: `bd list --parent <parent-id> --status all --json --limit 0` returns the full parent-scoped child set.
|
|
17
|
+
- **List open work**: `bd list --status open --json` returns open issues, including blocked issues; don't use it as a substitute for `bd ready --json`.
|
|
18
|
+
- **Add a dependency**: `bd dep add <blocked-issue-id> <blocking-issue-id> --type blocks`. The blocking issue is the second positional argument. `--blocked-by` is also accepted, but prefer the positional form.
|
|
19
|
+
- **Comment on an issue**: `bd comments add <ID> "..." --json`. For multiline agent briefs or triage notes, use `bd comments add <ID> -f notes.md --json` or a safely quoted multiline shell string.
|
|
20
|
+
- **Apply / remove labels**: `bd label add <ID> <label>` / `bd label remove <ID> <label>`
|
|
21
|
+
- **Claim work**: `bd update <ID> --claim --json` when a workflow asks an agent to claim an issue.
|
|
22
|
+
- **Close**: `bd close <ID> --reason "..." --json`
|
|
23
|
+
|
|
24
|
+
## When a skill says "publish to the issue tracker"
|
|
25
|
+
|
|
26
|
+
Create a Beads issue with `bd create "Title" --body-file - -t task -p 2 -l needs-triage --json`, passing the markdown body on stdin or from a body file.
|
|
27
|
+
|
|
28
|
+
## When a skill says "fetch the relevant ticket"
|
|
29
|
+
|
|
30
|
+
Run `bd show <ID> --json` and `bd comments <ID> --json`.
|
|
31
|
+
|
|
32
|
+
## When the triage skill asks for incoming work
|
|
33
|
+
|
|
34
|
+
Run `bd list --status open --json`, then inspect relevant issues with `bd show <ID> --json` and `bd comments <ID> --json`. Queue helpers: `bd list --status open --no-labels --json`, `bd list --status open --label needs-triage --json`, and `bd list --status open --label needs-info --json`.
|
|
35
|
+
|
|
36
|
+
For large parent-scoped triage, fetch the full child set up front with `bd list --parent <parent-id> --status all --json --limit 0`. Do not use `bd children <parent-id> --json` for exhaustive automation because it can hide matches behind the default limit and does not accept `--limit`. Apply label changes in batches where possible, then add generated comments in small chunks of 5 to 10 issues to avoid command timeouts and duplicate comments.
|
|
37
|
+
|
|
38
|
+
Derive triage buckets from labels and comments:
|
|
39
|
+
|
|
40
|
+
- **Unlabeled**: open issues with no triage-role label.
|
|
41
|
+
- **Needs triage**: issues labeled `needs-triage`.
|
|
42
|
+
- **Needs info**: issues labeled `needs-info`; read comments to see what information was requested and whether the reporter has answered.
|
|
43
|
+
|
|
44
|
+
Process oldest first when timestamp fields are present. For triage transitions, remove existing state-role labels before adding the new mapped triage label. Use `bd label add <ID> <label>`, `bd label remove <ID> <label>`, and `bd comments add <ID> -f notes.md --json` to record transitions. Category labels `bug` and `enhancement` are literal Beads labels unless the repo documents another mapping.
|
|
45
|
+
|
|
46
|
+
## When `/to-qa` needs completed child work
|
|
47
|
+
|
|
48
|
+
Fetch the full child set with `bd list --parent <parent-id> --status all --json --limit 0`.
|
|
49
|
+
|
|
50
|
+
Include only child issues whose status is closed, completed, or done according to this repo's Beads vocabulary. Exclude open, blocked, or incomplete children and report them as warnings.
|
|
51
|
+
|
|
52
|
+
For each included child, read `bd show <child-id> --json` and `bd comments <child-id> --json`.
|
|
53
|
+
|
|
54
|
+
Do not mutate Beads issues during `/to-qa`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Issue tracker: GitHub
|
|
2
|
+
|
|
3
|
+
Issues and PRDs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
|
|
8
|
+
- **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.
|
|
9
|
+
- **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
|
|
10
|
+
- **Comment on an issue**: `gh issue comment <number> --body "..."`
|
|
11
|
+
- **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
|
|
12
|
+
- **Close**: `gh issue close <number> --comment "..."`
|
|
13
|
+
|
|
14
|
+
Infer the repo from `git remote -v` — `gh` does this automatically when run inside a clone.
|
|
15
|
+
|
|
16
|
+
## When a skill says "publish to the issue tracker"
|
|
17
|
+
|
|
18
|
+
Create a GitHub issue.
|
|
19
|
+
|
|
20
|
+
## When a skill says "fetch the relevant ticket"
|
|
21
|
+
|
|
22
|
+
Run `gh issue view <number> --comments`.
|
|
23
|
+
|
|
24
|
+
## `/to-qa` support
|
|
25
|
+
|
|
26
|
+
This template does not define a default completed-child query for `/to-qa`. If this repo uses GitHub Issues with `/to-qa`, extend `docs/agents/issue-tracker.md` with:
|
|
27
|
+
|
|
28
|
+
- how parent issues link to child issues,
|
|
29
|
+
- how completed child work is identified,
|
|
30
|
+
- which issue states/labels count as completed,
|
|
31
|
+
- which command fetches the full child set.
|
|
32
|
+
|
|
33
|
+
Do not mutate GitHub issues during `/to-qa`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Issue tracker: GitLab
|
|
2
|
+
|
|
3
|
+
Issues and PRDs for this repo live as GitLab issues. Use the [`glab`](https://gitlab.com/gitlab-org/cli) CLI for all operations.
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- **Create an issue**: `glab issue create --title "..." --description "..."`. Use a heredoc for multi-line descriptions. Pass `--description -` to open an editor.
|
|
8
|
+
- **Read an issue**: `glab issue view <number> --comments`. Use `-F json` for machine-readable output.
|
|
9
|
+
- **List issues**: `glab issue list -F json` with appropriate `--label` filters.
|
|
10
|
+
- **Comment on an issue**: `glab issue note <number> --message "..."`. GitLab calls comments "notes".
|
|
11
|
+
- **Apply / remove labels**: `glab issue update <number> --label "..."` / `--unlabel "..."`. Multiple labels can be comma-separated or by repeating the flag.
|
|
12
|
+
- **Close**: `glab issue close <number>`. `glab issue close` does not accept a closing comment, so post the explanation first with `glab issue note <number> --message "..."`, then close.
|
|
13
|
+
- **Merge requests**: GitLab calls PRs "merge requests". Use `glab mr create`, `glab mr view`, `glab mr note`, etc. — the same shape as `gh pr ...` with `mr` in place of `pr` and `note`/`--message` in place of `comment`/`--body`.
|
|
14
|
+
|
|
15
|
+
Infer the repo from `git remote -v` — `glab` does this automatically when run inside a clone.
|
|
16
|
+
|
|
17
|
+
## When a skill says "publish to the issue tracker"
|
|
18
|
+
|
|
19
|
+
Create a GitLab issue.
|
|
20
|
+
|
|
21
|
+
## When a skill says "fetch the relevant ticket"
|
|
22
|
+
|
|
23
|
+
Run `glab issue view <number> --comments`.
|
|
24
|
+
|
|
25
|
+
## `/to-qa` support
|
|
26
|
+
|
|
27
|
+
This template does not define a default completed-child query for `/to-qa`. If this repo uses GitLab Issues with `/to-qa`, extend `docs/agents/issue-tracker.md` with:
|
|
28
|
+
|
|
29
|
+
- how parent issues link to child issues,
|
|
30
|
+
- how completed child work is identified,
|
|
31
|
+
- which issue states/labels count as completed,
|
|
32
|
+
- which command fetches the full child set.
|
|
33
|
+
|
|
34
|
+
Do not mutate GitLab issues during `/to-qa`.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Issue tracker: Local Markdown
|
|
2
|
+
|
|
3
|
+
Issues and PRDs for this repo live as markdown files in `.scratch/`.
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- One feature per directory: `.scratch/<feature-slug>/`
|
|
8
|
+
- The PRD is `.scratch/<feature-slug>/PRD.md`
|
|
9
|
+
- Implementation issues are `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01`
|
|
10
|
+
- Triage state is recorded as a `Status:` line near the top of each issue file (see `triage-labels.md` for the role strings)
|
|
11
|
+
- Comments and conversation history append to the bottom of the file under a `## Comments` heading
|
|
12
|
+
|
|
13
|
+
## When a skill says "publish to the issue tracker"
|
|
14
|
+
|
|
15
|
+
Create a new file under `.scratch/<feature-slug>/` (creating the directory if needed).
|
|
16
|
+
|
|
17
|
+
## When a skill says "fetch the relevant ticket"
|
|
18
|
+
|
|
19
|
+
Read the file at the referenced path. The user will normally pass the path or the issue number directly.
|
|
20
|
+
|
|
21
|
+
## When `/to-qa` needs completed child work
|
|
22
|
+
|
|
23
|
+
For a parent path or feature directory, read structured child issue files under `.scratch/<feature-slug>/issues/`.
|
|
24
|
+
|
|
25
|
+
Include only files whose `Status:` line is `closed`, `completed`, or `done`. Treat missing or unknown status as incomplete and report it as a warning.
|
|
26
|
+
|
|
27
|
+
Use the issue file path as the source issue ID/evidence. Do not create, rename, edit, close, or delete `.scratch` files during `/to-qa`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Triage Labels
|
|
2
|
+
|
|
3
|
+
The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
|
|
4
|
+
|
|
5
|
+
| Label in these skills | Label in our tracker | Meaning |
|
|
6
|
+
| --------------------- | -------------------- | ---------------------------------------- |
|
|
7
|
+
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
|
|
8
|
+
| `needs-info` | `needs-info` | Waiting on reporter for more information |
|
|
9
|
+
| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
|
|
10
|
+
| `ready-for-human` | `ready-for-human` | Requires human implementation |
|
|
11
|
+
| `wontfix` | `wontfix` | Will not be actioned |
|
|
12
|
+
|
|
13
|
+
When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
|
|
14
|
+
|
|
15
|
+
Edit the right-hand column to match whatever vocabulary you actually use.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-coding-quality-checks
|
|
3
|
+
description: Onboards a repo for local-only development by installing and documenting strict Coding Quality Checks that make AI-agent coding safer and more correct. Use when the user wants to set up or strengthen local formatters, linters, typechecks, tests, security scanners, build checks that already exist, or git hooks for a greenfield or brownfield repo.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setup Coding Quality Checks
|
|
7
|
+
|
|
8
|
+
Set up a local correctness environment where AI agents can work safely. Keep scope tight: formatter, linter, typecheck, tests, security scanners when warranted, git hooks, and existing build checks only. Do not turn this into a broad validation framework.
|
|
9
|
+
|
|
10
|
+
## Principles
|
|
11
|
+
|
|
12
|
+
- Use **Coding Quality Checks** as the umbrella term.
|
|
13
|
+
- Explore before asking. If repo evidence answers a question, use it.
|
|
14
|
+
- Ask one decision at a time, with a recommended answer.
|
|
15
|
+
- Prefer strict correctness over convenience; brownfield repos may fail immediately.
|
|
16
|
+
- Do not auto-format or lint-autofix source without separate confirmation.
|
|
17
|
+
- Do not invent build steps or aggregate commands. Preserve repo terminology.
|
|
18
|
+
- Sub-agents may discover and draft plans; the main agent owns decisions, confirmation, and edits.
|
|
19
|
+
|
|
20
|
+
## 1. Discover
|
|
21
|
+
|
|
22
|
+
Inspect before asking. Use sub-agents freely when useful; give each a radically different angle: stack discovery, existing tooling, security/hook risks, or greenfield planning clues.
|
|
23
|
+
|
|
24
|
+
Look for repo instructions (`AGENTS.md`, `.cursor/rules`, copilot instructions), Sandcastle docs (`.sandcastle/**/*.md`), package manifests, lockfiles, existing configs/scripts, tests, source layout, and existing CI files. Use CI as evidence, but ask before editing it.
|
|
25
|
+
|
|
26
|
+
For Beads, inspect `.beads/` and use read-only `bd` commands when available. Use issues for stack clues and acceptance criteria; never mutate Beads unless separately asked.
|
|
27
|
+
|
|
28
|
+
For greenfield repos, inspect README, PRDs, roadmap, Beads issues, package manifests, and planning docs before asking the user for the intended stack.
|
|
29
|
+
|
|
30
|
+
For transcripts, search only repo-local notes such as `.opencode/`, `.aider*`, `.continue/`, `transcripts/`, `chat.md`, `SESSION.md`, or `notes/`. Treat transcript evidence as weak and use it only for quality-check clues.
|
|
31
|
+
|
|
32
|
+
Evidence order: current user instruction; agent/repo docs and Sandcastle prompts; scripts/configs/manifests/lockfiles; Beads acceptance criteria; CI files; transcripts; source layout; ecosystem defaults.
|
|
33
|
+
|
|
34
|
+
Stop and ask if package-manager signals conflict. Never create a second lockfile family.
|
|
35
|
+
|
|
36
|
+
## 2. Interview
|
|
37
|
+
|
|
38
|
+
Present only relevant findings, then walk the user through decisions in this order. Skip irrelevant categories.
|
|
39
|
+
|
|
40
|
+
1. Local-only meaning: ask whether installs/scanner network access are allowed for this repo.
|
|
41
|
+
2. Formatter: recommend one formatter matching repo convention; add check-mode scripts; do not format files automatically.
|
|
42
|
+
3. Linter: recommend strict correctness linting that does not fight the formatter; add fix scripts only as explicit commands; do not autofix automatically.
|
|
43
|
+
4. Typecheck: recommend strict practical settings; warn brownfield repos about blast radius.
|
|
44
|
+
5. Tests: recommend local test tooling; if no tests exist, ask whether to add a minimal runner proof, no test files, or real starter tests.
|
|
45
|
+
6. Existing build checks: only discuss if the repo already has a meaningful build/package/compile command; no fake builds.
|
|
46
|
+
7. Security scanners: ask when warranted. Secret scanning is conditional opt-in for real credential risk. Dependency audits are opt-in when package-manager/lockfile evidence supports them. Call out network or telemetry.
|
|
47
|
+
8. Git hooks: recommend strict fast pre-commit hooks and keep slower checks separate unless the user accepts slow hooks.
|
|
48
|
+
9. Extra static-style checks: ask before including every extra, even when evidence suggests one.
|
|
49
|
+
10. Repo docs: recommend `docs/agents/coding-quality-checks.md` plus optional `AGENTS.md` agent block.
|
|
50
|
+
11. CI: if CI exists, ask whether to update it; default to no CI edits unless the user opts in.
|
|
51
|
+
|
|
52
|
+
For command naming, preserve repo lingo. If Sandcastle docs name exact commands like `npm run typecheck` and `npm run test`, preserve them as agent-facing commands. If no local lingo exists, ask before creating a fallback aggregate such as `check`.
|
|
53
|
+
|
|
54
|
+
## 3. Confirm
|
|
55
|
+
|
|
56
|
+
Before installing or editing, show this exact confirmation shape:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
I will set up local Coding Quality Checks with:
|
|
60
|
+
Package manager: <pm or none>
|
|
61
|
+
Tools/dev dependencies: <list>
|
|
62
|
+
Files expected to change: <list>
|
|
63
|
+
Scripts/commands added or changed: <list>
|
|
64
|
+
Git hooks: <exact behavior or none>
|
|
65
|
+
Security scanners: <local/offline/networked/none>
|
|
66
|
+
CI edits: <yes/no>
|
|
67
|
+
Auto-format/autofix source writes: none unless separately confirmed
|
|
68
|
+
|
|
69
|
+
Proceed with these exact changes?
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Stop if target files are dirty and conflict with planned edits, package-manager detection is ambiguous, a scanner violates the chosen local-only meaning, or an existing config cannot be merged safely.
|
|
73
|
+
|
|
74
|
+
## 4. Implement
|
|
75
|
+
|
|
76
|
+
After confirmation, make minimal, idempotent edits. Prefer existing config files and script conventions. Follow existing version pinning style. Never delete or replace existing configs unless explicitly approved.
|
|
77
|
+
|
|
78
|
+
Allowed after confirmation: package/tool configs, dev dependencies and lockfile updates, agreed scripts, agreed hook-manager config, `docs/agents/coding-quality-checks.md`, and optional agent instruction block.
|
|
79
|
+
|
|
80
|
+
Forbidden without separate confirmation: repo-wide formatting, lint autofix, generated-code rewrites, runtime dependency changes, CI edits unless opted in, and Beads mutations.
|
|
81
|
+
|
|
82
|
+
## 5. Document
|
|
83
|
+
|
|
84
|
+
Write `docs/agents/coding-quality-checks.md` with exact commands, what each command proves, known brownfield failures, and what agents should run before commits. If updating `AGENTS.md`, keep the block short and point to the doc.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
description: Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test-Driven Development
|
|
7
|
+
|
|
8
|
+
## Philosophy
|
|
9
|
+
|
|
10
|
+
**Core principle**: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
|
|
11
|
+
|
|
12
|
+
**Good tests** are integration-style: they exercise real code paths through public APIs. They describe _what_ the system does, not _how_ it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests survive refactors because they don't care about internal structure.
|
|
13
|
+
|
|
14
|
+
**Bad tests** are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.
|
|
15
|
+
|
|
16
|
+
See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
|
|
17
|
+
|
|
18
|
+
## Anti-Pattern: Horizontal Slices
|
|
19
|
+
|
|
20
|
+
**DO NOT write all tests first, then all implementation.** This is "horizontal slicing" - treating RED as "write all tests" and GREEN as "write all code."
|
|
21
|
+
|
|
22
|
+
This produces **crap tests**:
|
|
23
|
+
|
|
24
|
+
- Tests written in bulk test _imagined_ behavior, not _actual_ behavior
|
|
25
|
+
- You end up testing the _shape_ of things (data structures, function signatures) rather than user-facing behavior
|
|
26
|
+
- Tests become insensitive to real changes - they pass when behavior breaks, fail when behavior is fine
|
|
27
|
+
- You outrun your headlights, committing to test structure before understanding the implementation
|
|
28
|
+
|
|
29
|
+
**Correct approach**: Vertical slices via tracer bullets. One test → one implementation → repeat. Each test responds to what you learned from the previous cycle. Because you just wrote the code, you know exactly what behavior matters and how to verify it.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
WRONG (horizontal):
|
|
33
|
+
RED: test1, test2, test3, test4, test5
|
|
34
|
+
GREEN: impl1, impl2, impl3, impl4, impl5
|
|
35
|
+
|
|
36
|
+
RIGHT (vertical):
|
|
37
|
+
RED→GREEN: test1→impl1
|
|
38
|
+
RED→GREEN: test2→impl2
|
|
39
|
+
RED→GREEN: test3→impl3
|
|
40
|
+
...
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Workflow
|
|
44
|
+
|
|
45
|
+
### 1. Planning
|
|
46
|
+
|
|
47
|
+
When exploring the codebase, use the project's domain glossary so that test names and interface vocabulary match the project's language, and respect ADRs in the area you're touching.
|
|
48
|
+
|
|
49
|
+
Before writing any code:
|
|
50
|
+
|
|
51
|
+
- [ ] Confirm with user what interface changes are needed
|
|
52
|
+
- [ ] Confirm with user which behaviors to test (prioritize)
|
|
53
|
+
- [ ] Identify opportunities for [deep modules](deep-modules.md) (small interface, deep implementation)
|
|
54
|
+
- [ ] Design interfaces for [testability](interface-design.md)
|
|
55
|
+
- [ ] List the behaviors to test (not implementation steps)
|
|
56
|
+
- [ ] Get user approval on the plan
|
|
57
|
+
|
|
58
|
+
Ask: "What should the public interface look like? Which behaviors are most important to test?"
|
|
59
|
+
|
|
60
|
+
**You can't test everything.** Confirm with the user exactly which behaviors matter most. Focus testing effort on critical paths and complex logic, not every possible edge case.
|
|
61
|
+
|
|
62
|
+
### 2. Tracer Bullet
|
|
63
|
+
|
|
64
|
+
Write ONE test that confirms ONE thing about the system:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
RED: Write test for first behavior → test fails
|
|
68
|
+
GREEN: Write minimal code to pass → test passes
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This is your tracer bullet - proves the path works end-to-end.
|
|
72
|
+
|
|
73
|
+
### 3. Incremental Loop
|
|
74
|
+
|
|
75
|
+
For each remaining behavior:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
RED: Write next test → fails
|
|
79
|
+
GREEN: Minimal code to pass → passes
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Rules:
|
|
83
|
+
|
|
84
|
+
- One test at a time
|
|
85
|
+
- Only enough code to pass current test
|
|
86
|
+
- Don't anticipate future tests
|
|
87
|
+
- Keep tests focused on observable behavior
|
|
88
|
+
|
|
89
|
+
### 4. Refactor
|
|
90
|
+
|
|
91
|
+
After all tests pass, look for [refactor candidates](refactoring.md):
|
|
92
|
+
|
|
93
|
+
- [ ] Extract duplication
|
|
94
|
+
- [ ] Deepen modules (move complexity behind simple interfaces)
|
|
95
|
+
- [ ] Apply SOLID principles where natural
|
|
96
|
+
- [ ] Consider what new code reveals about existing code
|
|
97
|
+
- [ ] Run tests after each refactor step
|
|
98
|
+
|
|
99
|
+
**Never refactor while RED.** Get to GREEN first.
|
|
100
|
+
|
|
101
|
+
## Checklist Per Cycle
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
[ ] Test describes behavior, not implementation
|
|
105
|
+
[ ] Test uses public interface only
|
|
106
|
+
[ ] Test would survive internal refactor
|
|
107
|
+
[ ] Code is minimal for this test
|
|
108
|
+
[ ] No speculative features added
|
|
109
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Deep Modules
|
|
2
|
+
|
|
3
|
+
From "A Philosophy of Software Design":
|
|
4
|
+
|
|
5
|
+
**Deep module** = small interface + lots of implementation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
┌─────────────────────┐
|
|
9
|
+
│ Small Interface │ ← Few methods, simple params
|
|
10
|
+
├─────────────────────┤
|
|
11
|
+
│ │
|
|
12
|
+
│ │
|
|
13
|
+
│ Deep Implementation│ ← Complex logic hidden
|
|
14
|
+
│ │
|
|
15
|
+
│ │
|
|
16
|
+
└─────────────────────┘
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Shallow module** = large interface + little implementation (avoid)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
┌─────────────────────────────────┐
|
|
23
|
+
│ Large Interface │ ← Many methods, complex params
|
|
24
|
+
├─────────────────────────────────┤
|
|
25
|
+
│ Thin Implementation │ ← Just passes through
|
|
26
|
+
└─────────────────────────────────┘
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
When designing interfaces, ask:
|
|
30
|
+
|
|
31
|
+
- Can I reduce the number of methods?
|
|
32
|
+
- Can I simplify the parameters?
|
|
33
|
+
- Can I hide more complexity inside?
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface Design for Testability
|
|
2
|
+
|
|
3
|
+
Good interfaces make testing natural:
|
|
4
|
+
|
|
5
|
+
1. **Accept dependencies, don't create them**
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// Testable
|
|
9
|
+
function processOrder(order, paymentGateway) {}
|
|
10
|
+
|
|
11
|
+
// Hard to test
|
|
12
|
+
function processOrder(order) {
|
|
13
|
+
const gateway = new StripeGateway();
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Return results, don't produce side effects**
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
// Testable
|
|
21
|
+
function calculateDiscount(cart): Discount {}
|
|
22
|
+
|
|
23
|
+
// Hard to test
|
|
24
|
+
function applyDiscount(cart): void {
|
|
25
|
+
cart.total -= discount;
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. **Small surface area**
|
|
30
|
+
- Fewer methods = fewer tests needed
|
|
31
|
+
- Fewer params = simpler test setup
|