@heihei0299/matt-skills 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.
- package/.agents/skills/ask-matt/SKILL.md +78 -0
- package/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/.agents/skills/code-review/SKILL.md +94 -0
- package/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/.agents/skills/codebase-design/SKILL.md +114 -0
- package/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/.agents/skills/commit-check/SKILL.md +65 -0
- package/.agents/skills/commit-check/agents/openai.yaml +5 -0
- package/.agents/skills/commit-check/scripts/scan-sensitive.sh +36 -0
- package/.agents/skills/diagnose-fix/SKILL.md +66 -0
- package/.agents/skills/diagnose-fix/agents/openai.yaml +5 -0
- package/.agents/skills/diagnose-fix/references/anti-patterns.md +20 -0
- package/.agents/skills/diagnosing-bugs/SKILL.md +134 -0
- package/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
- package/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/.agents/skills/grill-me/SKILL.md +7 -0
- package/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/.agents/skills/grill-to-spec/SKILL.md +83 -0
- package/.agents/skills/grill-to-spec/agents/openai.yaml +5 -0
- package/.agents/skills/grill-to-spec/references/rules.md +33 -0
- package/.agents/skills/grill-with-docs/SKILL.md +7 -0
- package/.agents/skills/grill-with-docs/agents/openai.yaml +5 -0
- package/.agents/skills/grilling/SKILL.md +12 -0
- package/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/.agents/skills/handoff/SKILL.md +16 -0
- package/.agents/skills/handoff/agents/openai.yaml +5 -0
- package/.agents/skills/implement/SKILL.md +15 -0
- package/.agents/skills/implement/agents/openai.yaml +5 -0
- package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/.agents/skills/prototype/LOGIC.md +79 -0
- package/.agents/skills/prototype/SKILL.md +26 -0
- package/.agents/skills/prototype/UI.md +112 -0
- package/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/.agents/skills/research/SKILL.md +12 -0
- package/.agents/skills/research/agents/openai.yaml +3 -0
- package/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/.agents/skills/tdd/SKILL.md +36 -0
- package/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/.agents/skills/tdd/mocking.md +59 -0
- package/.agents/skills/tdd/tests.md +77 -0
- package/.agents/skills/tdd-implement/SKILL.md +143 -0
- package/.agents/skills/tdd-implement/agents/openai.yaml +5 -0
- package/.agents/skills/tdd-implement/references/stages.md +315 -0
- package/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/.agents/skills/teach/SKILL.md +140 -0
- package/.agents/skills/teach/agents/openai.yaml +5 -0
- package/.agents/skills/to-spec/SKILL.md +75 -0
- package/.agents/skills/to-spec/agents/openai.yaml +5 -0
- package/.agents/skills/to-tickets/SKILL.md +105 -0
- package/.agents/skills/to-tickets/agents/openai.yaml +5 -0
- package/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/.agents/skills/triage/SKILL.md +112 -0
- package/.agents/skills/triage/agents/openai.yaml +5 -0
- package/.agents/skills/wayfinder/SKILL.md +128 -0
- package/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/.agents/skills/writing-great-skills/GLOSSARY.md +201 -0
- package/.agents/skills/writing-great-skills/SKILL.md +83 -0
- package/.agents/skills/writing-great-skills/agents/openai.yaml +5 -0
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/bin/cli.js +353 -0
- package/package.json +26 -0
- package/template/.opencode/CONTEXT.md +47 -0
- package/template/.opencode/agents/issue-audit.md +52 -0
- package/template/.opencode/commands/grill-to-spec.md +13 -0
- package/template/.opencode/commands/handoff.md +12 -0
- package/template/.opencode/commands/improve-codebase-architecture.md +13 -0
- package/template/.opencode/commands/issue-audit.md +115 -0
- package/template/.opencode/commands/teach.md +12 -0
- package/template/.opencode/commands/to-spec.md +13 -0
- package/template/.opencode/commands/to-tickets.md +12 -0
- package/template/.opencode/commands/triage.md +12 -0
- package/template/.opencode/commands/wayfinder.md +13 -0
- package/template/.opencode/commands/writing-great-skills.md +12 -0
- package/template/.opencode/docs/agents/domain.md +51 -0
- package/template/.opencode/docs/agents/issue-tracker.md +30 -0
- package/template/.opencode/docs/agents/runtime-discipline.md +36 -0
- package/template/.opencode/docs/agents/skill-design.md +32 -0
- package/template/.opencode/docs/agents/triage-labels.md +15 -0
- package/template/.opencode/skills/commit-check/SKILL.md +65 -0
- package/template/.opencode/skills/commit-check/agents/openai.yaml +5 -0
- package/template/.opencode/skills/commit-check/scripts/scan-sensitive.sh +36 -0
- package/template/.opencode/skills/diagnose-fix/SKILL.md +66 -0
- package/template/.opencode/skills/diagnose-fix/agents/openai.yaml +5 -0
- package/template/.opencode/skills/diagnose-fix/references/anti-patterns.md +20 -0
- package/template/.opencode/skills/grill-to-spec/SKILL.md +83 -0
- package/template/.opencode/skills/grill-to-spec/agents/openai.yaml +5 -0
- package/template/.opencode/skills/grill-to-spec/references/rules.md +33 -0
- package/template/.opencode/skills/tdd-implement/SKILL.md +143 -0
- package/template/.opencode/skills/tdd-implement/agents/openai.yaml +5 -0
- package/template/.opencode/skills/tdd-implement/references/stages.md +315 -0
- package/template/.pi/agents/issue-audit.md +52 -0
- package/template/.pi/docs/agents/domain.md +51 -0
- package/template/.pi/docs/agents/issue-tracker.md +30 -0
- package/template/.pi/docs/agents/runtime-discipline.md +36 -0
- package/template/.pi/docs/agents/skill-design.md +32 -0
- package/template/.pi/docs/agents/triage-labels.md +15 -0
- package/template/.pi/prompts/issue-audit.md +114 -0
- package/template/.pi/skills/commit-check/SKILL.md +65 -0
- package/template/.pi/skills/commit-check/agents/openai.yaml +5 -0
- package/template/.pi/skills/commit-check/scripts/scan-sensitive.sh +36 -0
- package/template/.pi/skills/diagnose-fix/SKILL.md +66 -0
- package/template/.pi/skills/diagnose-fix/agents/openai.yaml +5 -0
- package/template/.pi/skills/diagnose-fix/references/anti-patterns.md +20 -0
- package/template/.pi/skills/grill-to-spec/SKILL.md +83 -0
- package/template/.pi/skills/grill-to-spec/agents/openai.yaml +5 -0
- package/template/.pi/skills/grill-to-spec/references/rules.md +33 -0
- package/template/.pi/skills/tdd-implement/SKILL.md +143 -0
- package/template/.pi/skills/tdd-implement/agents/openai.yaml +5 -0
- package/template/.pi/skills/tdd-implement/references/stages.md +315 -0
- package/template/AGENTS.md +59 -0
|
@@ -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 `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) 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 `/domain-modeling`).
|
|
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,45 @@
|
|
|
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
|
+
## Pull requests as a triage surface
|
|
17
|
+
|
|
18
|
+
**PRs as a request surface: no.** _(Set to `yes` if this repo treats external PRs as feature requests; `/triage` reads this flag.)_
|
|
19
|
+
|
|
20
|
+
When set to `yes`, PRs run through the same labels and states as issues, using the `gh pr` equivalents:
|
|
21
|
+
|
|
22
|
+
- **Read a PR**: `gh pr view <number> --comments` and `gh pr diff <number>` for the diff.
|
|
23
|
+
- **List external PRs for triage**: `gh pr list --state open --json number,title,body,labels,author,authorAssociation,comments` then keep only `authorAssociation` of `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, or `NONE` (drop `OWNER`/`MEMBER`/`COLLABORATOR`).
|
|
24
|
+
- **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
|
|
25
|
+
|
|
26
|
+
GitHub shares one number space across issues and PRs, so a bare `#42` may be either — resolve with `gh pr view 42` and fall back to `gh issue view 42`.
|
|
27
|
+
|
|
28
|
+
## When a skill says "publish to the issue tracker"
|
|
29
|
+
|
|
30
|
+
Create a GitHub issue.
|
|
31
|
+
|
|
32
|
+
## When a skill says "fetch the relevant ticket"
|
|
33
|
+
|
|
34
|
+
Run `gh issue view <number> --comments`.
|
|
35
|
+
|
|
36
|
+
## Wayfinding operations
|
|
37
|
+
|
|
38
|
+
Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
|
|
39
|
+
|
|
40
|
+
- **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `gh issue create --label wayfinder:map`.
|
|
41
|
+
- **Child ticket**: an issue linked to the map as a GitHub sub-issue (`gh api` on the sub-issues endpoint). Where sub-issues aren't enabled, add the child to a task list in the map body and put `Part of #<map>` at the top of the child body. Labels: `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
|
|
42
|
+
- **Blocking**: GitHub's **native issue dependencies** — the canonical, UI-visible representation. Add an edge with `gh api --method POST repos/<owner>/<repo>/issues/<child>/dependencies/blocked_by -F issue_id=<blocker-db-id>`, where `<blocker-db-id>` is the blocker's numeric **database id** (`gh api repos/<owner>/<repo>/issues/<n> --jq .id`, _not_ the `#number` or `node_id`). GitHub reports `issue_dependencies_summary.blocked_by` (open blockers only — the live gate). Where dependencies aren't available, fall back to a `Blocked by: #<n>, #<n>` line at the top of the child body. A ticket is unblocked when every blocker is closed.
|
|
43
|
+
- **Frontier query**: list the map's open children (`gh issue list --state open`, scoped to the map's sub-issues / task list), drop any with an open blocker (`issue_dependencies_summary.blocked_by > 0`, or an open issue in the `Blocked by` line) or an assignee; first in map order wins.
|
|
44
|
+
- **Claim**: `gh issue edit <n> --add-assignee @me` — the session's first write.
|
|
45
|
+
- **Resolve**: `gh issue comment <n> --body "<answer>"`, then `gh issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
## Merge requests as a triage surface
|
|
18
|
+
|
|
19
|
+
**MRs as a request surface: no.** _(Set to `yes` if this repo treats external merge requests as feature requests; `/triage` reads this flag.)_
|
|
20
|
+
|
|
21
|
+
When set to `yes`, MRs run through the same labels and states as issues, using the `glab mr` equivalents:
|
|
22
|
+
|
|
23
|
+
- **Read an MR**: `glab mr view <number> --comments` and `glab mr diff <number>` for the diff.
|
|
24
|
+
- **List external MRs for triage**: `glab mr list -F json`, then keep only MRs whose author is not a project member/owner (a contributor's MR, not a maintainer's in-flight work).
|
|
25
|
+
- **Comment / label / close**: `glab mr note`, `glab mr update --label`/`--unlabel`, `glab mr close`.
|
|
26
|
+
|
|
27
|
+
Unlike GitHub, GitLab numbers issues and MRs separately, so `#42` is unambiguous once you know which surface the maintainer means.
|
|
28
|
+
|
|
29
|
+
## When a skill says "publish to the issue tracker"
|
|
30
|
+
|
|
31
|
+
Create a GitLab issue.
|
|
32
|
+
|
|
33
|
+
## When a skill says "fetch the relevant ticket"
|
|
34
|
+
|
|
35
|
+
Run `glab issue view <number> --comments`.
|
|
36
|
+
|
|
37
|
+
## Wayfinding operations
|
|
38
|
+
|
|
39
|
+
Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
|
|
40
|
+
|
|
41
|
+
- **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `glab issue create --label wayfinder:map`. (On GitLab tiers with native epics, an epic may hold the map instead; a labelled issue works everywhere.)
|
|
42
|
+
- **Child ticket**: an issue carrying `Part of #<map>` at the top of its description and labels `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
|
|
43
|
+
- **Blocking**: GitLab's **native blocking link** — the canonical, UI-visible representation. Add it with the `/blocked_by #<n>` quick action, posted as a note (`glab issue note <child> --message "/blocked_by #<blocker>"`). Native blocking links are a Premium/Ultimate feature; on the free tier (or where unavailable) fall back to a `Blocked by: #<n>, #<n>` line at the top of the description. A ticket is unblocked when every blocker is closed.
|
|
44
|
+
- **Frontier query**: `glab issue list -F json` scoped to the map's children, drop any with an open blocker — a native `blocked_by` link to an open issue (`glab api projects/:id/issues/:iid/links`), or an open issue in the `Blocked by` line — or an assignee; first in map order wins.
|
|
45
|
+
- **Claim**: `glab issue update <n> --assignee @me` — the session's first write.
|
|
46
|
+
- **Resolve**: `glab issue note <n> --message "<answer>"`, then `glab issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Issue tracker: Local Markdown
|
|
2
|
+
|
|
3
|
+
Issues and specs (you may know a spec as a PRD) for this repo live as markdown files in `.scratch/`.
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- One feature per directory: `.scratch/<feature-slug>/`
|
|
8
|
+
- The spec is `.scratch/<feature-slug>/spec.md`
|
|
9
|
+
- Implementation issues are one file per ticket at `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01` — never a single combined tickets file
|
|
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
|
+
## Wayfinding operations
|
|
22
|
+
|
|
23
|
+
Used by `/wayfinder`. The **map** is a file with one **child** file per ticket.
|
|
24
|
+
|
|
25
|
+
- **Map**: `.scratch/<effort>/map.md` — the Notes / Decisions-so-far / Fog body.
|
|
26
|
+
- **Child ticket**: `.scratch/<effort>/issues/NN-<slug>.md`, numbered from `01`, with the question in the body. A `Type:` line records the ticket type (`research`/`prototype`/`grilling`/`task`); a `Status:` line records `claimed`/`resolved`.
|
|
27
|
+
- **Blocking**: a `Blocked by: NN, NN` line near the top. A ticket is unblocked when every file it lists is `resolved`.
|
|
28
|
+
- **Frontier**: scan `.scratch/<effort>/issues/` for files that are open, unblocked, and unclaimed; first by number wins.
|
|
29
|
+
- **Claim**: set `Status: claimed` and save before any work.
|
|
30
|
+
- **Resolve**: append the answer under an `## Answer` heading, set `Status: resolved`, then append a context pointer (gist + link) to the map's Decisions-so-far in `map.md`.
|
|
@@ -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 mattpocock/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,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
description: Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test-Driven Development
|
|
7
|
+
|
|
8
|
+
TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle — consult them before and during the loop, not after.
|
|
9
|
+
|
|
10
|
+
When exploring the codebase, read `CONTEXT.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
|
|
11
|
+
|
|
12
|
+
## What a good test is
|
|
13
|
+
|
|
14
|
+
Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification — "user can checkout with valid cart" tells you exactly what capability exists — and survives refactors because it doesn't care about internal structure.
|
|
15
|
+
|
|
16
|
+
See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
|
|
17
|
+
|
|
18
|
+
## Seams — where tests go
|
|
19
|
+
|
|
20
|
+
A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
|
|
21
|
+
|
|
22
|
+
**Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything — agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
|
|
23
|
+
|
|
24
|
+
Ask: "What's the public interface, and which seams should we test?"
|
|
25
|
+
|
|
26
|
+
## Anti-patterns
|
|
27
|
+
|
|
28
|
+
- **Implementation-coupled** — mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.
|
|
29
|
+
- **Tautological** — the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth — a known-good literal, a worked example, the spec.
|
|
30
|
+
- **Horizontal slicing** — writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead — one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.
|
|
31
|
+
|
|
32
|
+
## Rules of the loop
|
|
33
|
+
|
|
34
|
+
- **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
|
|
35
|
+
- **One slice at a time.** One seam, one test, one minimal implementation per cycle.
|
|
36
|
+
- **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# When to Mock
|
|
2
|
+
|
|
3
|
+
Mock at **system boundaries** only:
|
|
4
|
+
|
|
5
|
+
- External APIs (payment, email, etc.)
|
|
6
|
+
- Databases (sometimes - prefer test DB)
|
|
7
|
+
- Time/randomness
|
|
8
|
+
- File system (sometimes)
|
|
9
|
+
|
|
10
|
+
Don't mock:
|
|
11
|
+
|
|
12
|
+
- Your own classes/modules
|
|
13
|
+
- Internal collaborators
|
|
14
|
+
- Anything you control
|
|
15
|
+
|
|
16
|
+
## Designing for Mockability
|
|
17
|
+
|
|
18
|
+
At system boundaries, design interfaces that are easy to mock:
|
|
19
|
+
|
|
20
|
+
**1. Use dependency injection**
|
|
21
|
+
|
|
22
|
+
Pass external dependencies in rather than creating them internally:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// Easy to mock
|
|
26
|
+
function processPayment(order, paymentClient) {
|
|
27
|
+
return paymentClient.charge(order.total);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Hard to mock
|
|
31
|
+
function processPayment(order) {
|
|
32
|
+
const client = new StripeClient(process.env.STRIPE_KEY);
|
|
33
|
+
return client.charge(order.total);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**2. Prefer SDK-style interfaces over generic fetchers**
|
|
38
|
+
|
|
39
|
+
Create specific functions for each external operation instead of one generic function with conditional logic:
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
// GOOD: Each function is independently mockable
|
|
43
|
+
const api = {
|
|
44
|
+
getUser: (id) => fetch(`/users/${id}`),
|
|
45
|
+
getOrders: (userId) => fetch(`/users/${userId}/orders`),
|
|
46
|
+
createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// BAD: Mocking requires conditional logic inside the mock
|
|
50
|
+
const api = {
|
|
51
|
+
fetch: (endpoint, options) => fetch(endpoint, options),
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The SDK approach means:
|
|
56
|
+
- Each mock returns one specific shape
|
|
57
|
+
- No conditional logic in test setup
|
|
58
|
+
- Easier to see which endpoints a test exercises
|
|
59
|
+
- Type safety per endpoint
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Good and Bad Tests
|
|
2
|
+
|
|
3
|
+
## Good Tests
|
|
4
|
+
|
|
5
|
+
**Integration-style**: Test through real interfaces, not mocks of internal parts.
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// GOOD: Tests observable behavior
|
|
9
|
+
test("user can checkout with valid cart", async () => {
|
|
10
|
+
const cart = createCart();
|
|
11
|
+
cart.add(product);
|
|
12
|
+
const result = await checkout(cart, paymentMethod);
|
|
13
|
+
expect(result.status).toBe("confirmed");
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Characteristics:
|
|
18
|
+
|
|
19
|
+
- Tests behavior users/callers care about
|
|
20
|
+
- Uses public API only
|
|
21
|
+
- Survives internal refactors
|
|
22
|
+
- Describes WHAT, not HOW
|
|
23
|
+
- One logical assertion per test
|
|
24
|
+
|
|
25
|
+
## Bad Tests
|
|
26
|
+
|
|
27
|
+
**Implementation-detail tests**: Coupled to internal structure.
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// BAD: Tests implementation details
|
|
31
|
+
test("checkout calls paymentService.process", async () => {
|
|
32
|
+
const mockPayment = jest.mock(paymentService);
|
|
33
|
+
await checkout(cart, payment);
|
|
34
|
+
expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Red flags:
|
|
39
|
+
|
|
40
|
+
- Mocking internal collaborators
|
|
41
|
+
- Testing private methods
|
|
42
|
+
- Asserting on call counts/order
|
|
43
|
+
- Test breaks when refactoring without behavior change
|
|
44
|
+
- Test name describes HOW not WHAT
|
|
45
|
+
- Verifying through external means instead of interface
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// BAD: Bypasses interface to verify
|
|
49
|
+
test("createUser saves to database", async () => {
|
|
50
|
+
await createUser({ name: "Alice" });
|
|
51
|
+
const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
|
|
52
|
+
expect(row).toBeDefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// GOOD: Verifies through interface
|
|
56
|
+
test("createUser makes user retrievable", async () => {
|
|
57
|
+
const user = await createUser({ name: "Alice" });
|
|
58
|
+
const retrieved = await getUser(user.id);
|
|
59
|
+
expect(retrieved.name).toBe("Alice");
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Tautological tests**: Expected value restates the implementation, so the test passes by construction.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
// BAD: Expected value is recomputed the way the code computes it
|
|
67
|
+
test("calculateTotal sums line items", () => {
|
|
68
|
+
const items = [{ price: 10 }, { price: 5 }];
|
|
69
|
+
const expected = items.reduce((sum, i) => sum + i.price, 0);
|
|
70
|
+
expect(calculateTotal(items)).toBe(expected);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// GOOD: Expected value is an independent, known literal
|
|
74
|
+
test("calculateTotal sums line items", () => {
|
|
75
|
+
expect(calculateTotal([{ price: 10 }, { price: 5 }])).toBe(15);
|
|
76
|
+
});
|
|
77
|
+
```
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-implement
|
|
3
|
+
description: "Implement from a spec or ticket via strict TDD red-green loop, then typecheck, review, commit, update the issue status, and write an implementation summary. Use this skill whenever the user asks to implement from a spec/ticket/issue, mentions TDD/red-green/test-first, or wants test-first work carried through review, commit and issue close-out in one pass — even if they don't name the process. For implementation without the test-first pipeline use implement; for test technique alone use tdd — this skill is the complete orchestration."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TDD Implement
|
|
7
|
+
|
|
8
|
+
整合 **implement** + **tdd** 的完整实现流程:每个 seam 一个红-绿循环,直到 commit。TDD 语义(红-绿循环、seam 定义、好测试标准)以 [tdd 技能](.agents/skills/tdd/SKILL.md) 为唯一事实源——测试标准详见 [tdd/tests.md](.agents/skills/tdd/tests.md),Mock 边界见 [tdd/mocking.md](.agents/skills/tdd/mocking.md);本技能只编排阶段与运行时规则。
|
|
9
|
+
|
|
10
|
+
本技能是**长程任务**(Long-Horizon Skill):多阶段串行执行,自带**回合连续性**(Turn Continuity)与**任务分解**(Chunking)规则(见 [stages.md](references/stages.md) 阶段③ 3e/3f)。术语定义见 `CONTEXT.md`,技能设计规则见 `docs/agents/skill-design.md`。
|
|
11
|
+
|
|
12
|
+
## 流程速览
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
① 理解需求 → ② 确认 Seams → ③ TDD 开发循环 → ④ 完整测试套件 → ⑤ Code Review → ⑥ Commit → ⑦ 收尾(文档对齐 + issue 状态 + 实施总结)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
每阶段的入口条件、操作与边界规则见 [`stages.md`](references/stages.md)——进入任一阶段前先读取该阶段的定义。③ TDD 开发循环的红-绿规则见 [tdd 技能](.agents/skills/tdd/SKILL.md),不在本文件重写。多 issue 编排见下节与 [`stages.md` 附录:多 issue 编排](references/stages.md#附录-多-issue-编排按依赖分层并行)。
|
|
19
|
+
|
|
20
|
+
阶段要点:
|
|
21
|
+
- ⑤ Code Review:按 [code-review](.agents/skills/code-review/SKILL.md) **双轴审查**——Standards 轴(编码标准符合度)与 Spec 轴(spec/issue 实现忠实度),两轴独立报告互不掩盖;审查结果只在对话输出,不生成书面审查报告(不落盘 `review-*.md` 类文件)。**派发纪律:两轴必须用 subagent single 模式或 `subagent_consult` 逐个派发,禁止 parallel `tasks` 数组**(parallel 结果仅保留 160 字节摘要,中文报告必截断;详见 stages.md 阶段⑤)
|
|
22
|
+
- ⑥ Commit:commit 前运行 [commit-check](.agents/skills/commit-check/SKILL.md) 门禁(①审查文档 ②对齐 README ③目录卫生 ④commit message),四项全过才提交
|
|
23
|
+
- ⑦ 收尾:先对齐文档——检查 README 与 docs/ 中涉及本次实现的描述与实现是否一致,不一致则更新并 commit;再更新 issue 状态(有关联 issue 时,其验收标准逐条转写为 checkbox 清单并打勾——全部 `- [x]` 才允许标 `resolved`);最后保持目录卫生(清理 `[DEBUG-...]` 调试残留与临时产物,`git status` 确认工作区干净)
|
|
24
|
+
|
|
25
|
+
## 多 issue 编排(按依赖分层并行)
|
|
26
|
+
|
|
27
|
+
当 `.scratch/<feature>/issues/` 下存在多个 issue 且彼此有 `Blocked by` 依赖时走本模式;单 issue / 单 spec 仍走上节单线流程。触发后主代理为**编排器**,子代理按**单 issue 单代理**各自治完成完整 tdd-implement 流程(①→⑦)。详规见 [`stages.md` 附录](references/stages.md#附录-多-issue-编排按依赖分层并行),本节只定契约:
|
|
28
|
+
|
|
29
|
+
- **触发**:扫描 `.scratch/<feature>/issues/` 多文件且含 `Blocked by` 时进入编排模式;否则单线执行——不为单 issue 引入编排开销。
|
|
30
|
+
- **编排器职责**:解析 `Blocked by` 依赖图 → 拓扑分层 → 按层调度子代理 → 逐 issue 验收(见下)→ 层间收敛验证(全量测试 + `git status` 干净)→ 汇总实施总结。
|
|
31
|
+
- **子代理契约(单 issue 单代理)**:输入 `spec.md + 单个 issue.md + CONTEXT.md/ADRs`,严格走 tdd-implement ①→⑦(含 seams 确认、红-绿循环、typecheck、双轴 review、commit-check 门禁、issue `resolved` + 实施总结);产出独立 commit;禁止跨 issue 改动。
|
|
32
|
+
- **子代理输出约束**:只返回**回执卡片**(结构化关键信息),不透传全量过程日志。回执字段:issue 编号与标题 / commit hash / seams 清单 / 测试结果(数量与是否全绿)/ typecheck 结论 / 双轴 review 结论 / 验收 checkbox 结果 / 文档对齐清单 / 遗留与风险。红-绿细节、typecheck 原始输出、review 全文等过程日志留在子代理内部,不向主代理透传。
|
|
33
|
+
- **主代理验收**:编排器不盲信回执,逐 issue 验收后才算该 issue 完成。验收项:① commit 存在且 message 含 issue 编号 ② issue 文件 `Status: resolved` + `## 实施总结` 已落盘 ③ 抽检验证(抽跑相关测试或 `tsc --noEmit` 抽检,不重跑全量)④ 无跨 issue 改动(`git diff --name-only` 核对)⑤ 工作区干净。任一项不通过则打回重派该子代理,层内其他已通过不受影响;验收通过才计入层收敛。
|
|
34
|
+
- **分层并行**:同层无依赖的 issue 并行派发子代理,层内全部验收通过后才进入下一层;层间串行,层内并行。
|
|
35
|
+
- **冲突处理**:同层子代理若触及同一文件,后完成者 rebase 解决冲突后重跑 typecheck + 相关测试;跨层天然串行无冲突。
|
|
36
|
+
- **收敛**:全部层验收通过后编排器跑全量测试套件 + 目录卫生检查,任一失败按回退路由回到对应层重派。
|
|
37
|
+
|
|
38
|
+
## 回合连续性规则
|
|
39
|
+
|
|
40
|
+
flash 类模型在长程任务上容易在"预告下一步"处提前收尾——本规则源自一次真实事故(一次会话停四次,见 docs/agents/skill-design.md),是长程技能能否跑完的决定性规则。每个逻辑单元(一次红-绿循环、一次 typecheck、一次测试失败修复)必须**在一个回合内连续执行完毕后才输出**:测试 → 分析失败 → 修正 → 重跑 → 全绿 整条链一气呵成,中间不停顿、不等用户说"继续"。
|
|
41
|
+
|
|
42
|
+
回合终点仅为三类之一:
|
|
43
|
+
- **合规交互点**:技能要求的用户确认(如阶段② seams 清单确认)——此时提问并等待
|
|
44
|
+
- **外部阻塞**:权限拒绝、缺失授权、依赖不可用——此时明确说明需要什么授权或替代路径,不静默停止
|
|
45
|
+
- **阶段完成**:整个阶段的出口条件满足(如阶段③的所有 seams 红-绿完成 + typecheck 通过、commit 完成)——单个 seam 全绿只是阶段③的内部步骤,不是回合终点
|
|
46
|
+
|
|
47
|
+
输出进度/预告本身不结束回合——输出后继续执行,直到三类终点之一达成;预告下一步后立即执行该步骤。逐 seam 的执行细则见 [stages.md 3e](references/stages.md#阶段-③tdd-开发循环)。
|
|
48
|
+
|
|
49
|
+
编排模式下回合连续性延伸至**层**:一层内全部子代理派发后,编排器等待该层全 `resolved` 再进入下一层,不在层间停顿等待用户"继续";子代理内部仍遵守单 issue 的回合连续性。
|
|
50
|
+
|
|
51
|
+
## 不做什么
|
|
52
|
+
|
|
53
|
+
- 不重写 TDD 语义:红-绿循环、seam 定义、好测试标准、mocking 边界一律查 [tdd 技能](.agents/skills/tdd/SKILL.md),本技能只编排阶段与运行时规则
|
|
54
|
+
- 不把重构塞进红-绿循环:重构归阶段⑤ Code Review
|
|
55
|
+
- 不在阶段间停顿:单 seam 全绿、单次 typecheck 通过都不是回合终点(见回合连续性规则)
|
|
56
|
+
- 不生成书面审查报告:阶段⑤审查结果只在对话输出,不落盘 `review-*.md` 类文件
|
|
57
|
+
- 不手写超大改动:巨型 write/批量 replace 会撞输出上限、中途截断,因此单次 `write` 超 ~150 行先写骨架再分批补全;批量 `replace` 超 ~5 处先拆分再分批执行(见 [stages.md](references/stages.md) 3f)
|
|
58
|
+
- 不跳步:阶段出口未达成不进入下一阶段(见路由规则)
|
|
59
|
+
- 不为单 issue 引入编排:单 issue / 单 spec 不走多 issue 编排分支
|
|
60
|
+
|
|
61
|
+
## 任务拆分与 Todo 规定
|
|
62
|
+
|
|
63
|
+
### 拆分层级(大小任务层次)
|
|
64
|
+
|
|
65
|
+
1. **大任务**:Goal/Ticket——整个实现单元,对应一次完整的 tdd-implement 流程
|
|
66
|
+
2. **中任务**:Seam(阶段②确认)——一个红-绿循环单元,每 seam 一个 Todo
|
|
67
|
+
3. **小任务**:Todo——seam 内可独立验证、可勾选的执行单元(T1/T2/T3…)
|
|
68
|
+
4. **执行步**:Subtodo——Todo 内的串行步骤(红 → 绿 → typecheck),回合内逐步勾选推进
|
|
69
|
+
|
|
70
|
+
编排模式下新增一层:
|
|
71
|
+
|
|
72
|
+
5. **编排层**:Feature——`.scratch/<feature>/` 下全部 issues,按 `Blocked by` 分层;每层一组并行子代理,每子代理一个 issue 的完整 ①→⑦。
|
|
73
|
+
|
|
74
|
+
### Todo 清单格式
|
|
75
|
+
阶段② seams 确认后立即生成 todo 清单,每个 seam 一个 todo:
|
|
76
|
+
- 编号:`T1`、`T2`、`T3`…
|
|
77
|
+
- 描述:seam 名称 + 输入 + 预期输出
|
|
78
|
+
- 状态:`pending` / `in-progress` / `done` / `blocked`
|
|
79
|
+
- 完成标准(DoD):该 seam 测试全绿 + typecheck 通过 + 既有测试不受影响
|
|
80
|
+
- 执行步(Subtodo):`T1-R` 红(写失败测试)→ `T1-G` 绿(最小实现)→ `T1-T` typecheck
|
|
81
|
+
|
|
82
|
+
编排模式下 Todo 清单为**分层清单**:`L1: [01, 02] → L2: [03, 04] → L3: [05]`,每层内 issue 并行,层间串行;每 issue 的 DoD 为 `Status: resolved` + 独立 commit + 实施总结已落盘。
|
|
83
|
+
|
|
84
|
+
### Todo 状态机
|
|
85
|
+
```
|
|
86
|
+
pending → in-progress → done
|
|
87
|
+
↘ blocked(外部阻塞)→(授权/替代路径)→ in-progress
|
|
88
|
+
```
|
|
89
|
+
- Subtodo 不单独设 `blocked`——阻塞状态归父 Todo,Subtodo 跟随父状态
|
|
90
|
+
|
|
91
|
+
编排模式下 issue 粒度状态机:`pending → in-progress(子代理已派发) → done(Status: resolved)`;`blocked` 表示 `Blocked by` 依赖未满足,待前层全 `resolved` 后自动解阻。
|
|
92
|
+
|
|
93
|
+
### 粒度与回合归属
|
|
94
|
+
- 一个 todo = 一个 seam 的红-绿 cycle + typecheck,不可再拆
|
|
95
|
+
- 一个 todo 必须在一个回合内完成(红→绿→typecheck→全绿)
|
|
96
|
+
- Subtodo 是 todo 内的执行步:每完成一步立即进入下一步(`T1-R` → `T1-G` → `T1-T`),禁止停在步间预告
|
|
97
|
+
- 每完成一个 todo 立即更新其状态,再进入下一个
|
|
98
|
+
- todo 状态只按实际推进更新(pending → in-progress → done),不基于旧快照重写整个清单;已完成项(done)永不回退
|
|
99
|
+
- 全部 todo 为 done 才进入阶段④
|
|
100
|
+
|
|
101
|
+
编排模式下:每层全部 issue `done` 才进入下一层;全部层 `done` 后编排器做全量收敛验证。
|
|
102
|
+
|
|
103
|
+
### 阻塞处理
|
|
104
|
+
- 外部阻塞(权限拒绝、缺失授权、依赖不可用)→ 标记 `blocked`,记录所需授权或替代路径
|
|
105
|
+
- 不静默停止;恢复后回到 `in-progress` 继续
|
|
106
|
+
|
|
107
|
+
编排模式下:`Blocked by` 依赖阻塞由编排器自动管理——前层未全 `resolved` 时后层 `blocked`,前层收敛后自动解阻派发;不需人工确认依赖满足。
|
|
108
|
+
|
|
109
|
+
## 路由规则
|
|
110
|
+
|
|
111
|
+
### 正常流转
|
|
112
|
+
|
|
113
|
+
| 当前阶段 | 出口条件 | 下一阶段 |
|
|
114
|
+
|----------|----------|----------|
|
|
115
|
+
| ① 理解需求 | 需求已澄清,无歧义 | → ② 确认 Seams |
|
|
116
|
+
| ② 确认 Seams | 用户确认 seams 清单 | → ③ TDD 开发 |
|
|
117
|
+
| ③ TDD 开发 | 所有 seams 红-绿完成,typecheck 通过 | → ④ 完整测试套件 |
|
|
118
|
+
| ④ 完整测试套件 | 全部测试通过 | → ⑤ Code Review |
|
|
119
|
+
| ⑤ Code Review | 审查通过 | → ⑥ Commit |
|
|
120
|
+
| ⑥ Commit | commit 完成 | → ⑦ 收尾 |
|
|
121
|
+
| ⑦ 收尾 | issue 状态已更新 + 实施总结已写 | ✅ 结束 |
|
|
122
|
+
|
|
123
|
+
编排模式流转:`编排器:依赖图 → 分层 → [层内并行子代理(①→⑦) → 层收敛]×N → 全量收敛 → 汇总总结 ✅`;子代理内部仍走上表单 issue 流转。
|
|
124
|
+
|
|
125
|
+
### 回退路由
|
|
126
|
+
|
|
127
|
+
| 当前阶段 | 回退条件 | 回退目标 |
|
|
128
|
+
|----------|----------|----------|
|
|
129
|
+
| ③ TDD 开发 | typecheck 失败 | → ③ 修复类型错误 |
|
|
130
|
+
| ④ 完整测试套件 | 测试失败 | → ③ 修复失败测试 |
|
|
131
|
+
| ⑤ Code Review | 实现错误 | → ③ 修复实现 |
|
|
132
|
+
| ⑤ Code Review | seams 遗漏 | → ② 补充 seams |
|
|
133
|
+
| ⑤ Code Review | 需求偏差 | → ① 澄清需求 |
|
|
134
|
+
|
|
135
|
+
编排模式回退:子代理内回退按上表在子代理内闭环;编排器层收敛失败(全量测试失败 / 目录不干净)→ 定位到失败 issue 所在层重派对应子代理。
|
|
136
|
+
|
|
137
|
+
## 引用
|
|
138
|
+
|
|
139
|
+
- TDD 核心规则:[tdd 技能](.agents/skills/tdd/SKILL.md)
|
|
140
|
+
- 测试标准:[tdd/tests.md](.agents/skills/tdd/tests.md)
|
|
141
|
+
- Mock 指南:[tdd/mocking.md](.agents/skills/tdd/mocking.md)
|
|
142
|
+
- Commit 门禁:[commit-check 技能](.agents/skills/commit-check/SKILL.md)
|
|
143
|
+
- Issue tracker 约定:[issue-tracker.md](../../docs/agents/issue-tracker.md)
|