infinity-harness 2.0.0 → 2.0.2

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 (48) hide show
  1. package/CHANGELOG.md +95 -4
  2. package/README.md +30 -3
  3. package/harness/docs/ARCHITECTURE.md +1 -1
  4. package/harness/docs/agents/generator.md +1 -1
  5. package/harness/docs/agents/simplifier.md +1 -1
  6. package/harness/docs/phases/build.md +6 -6
  7. package/harness/docs/phases/define.md +4 -4
  8. package/harness/docs/phases/plan.md +4 -4
  9. package/harness/docs/phases/review.md +5 -5
  10. package/harness/docs/phases/ship.md +5 -5
  11. package/harness/docs/phases/simplify.md +6 -6
  12. package/harness/docs/phases/verify.md +6 -6
  13. package/harness/docs/skills.md +89 -0
  14. package/harness/skills/auth-security.md +1 -0
  15. package/harness/skills/building-tools.md +35 -39
  16. package/harness/skills/capability-acquisition.md +51 -48
  17. package/harness/skills/cli-design.md +3 -3
  18. package/harness/skills/code-review.md +1 -0
  19. package/harness/skills/codebase-design.md +1 -0
  20. package/harness/skills/concurrency-async.md +1 -0
  21. package/harness/skills/config-and-secrets.md +1 -0
  22. package/harness/skills/context-hygiene.md +1 -0
  23. package/harness/skills/databases.md +1 -0
  24. package/harness/skills/diagnosing-bugs.md +1 -0
  25. package/harness/skills/domain-modeling.md +1 -0
  26. package/harness/skills/error-handling-logging.md +1 -0
  27. package/harness/skills/frontend-ui.md +1 -0
  28. package/harness/skills/grilling.md +1 -0
  29. package/harness/skills/http-apis.md +1 -0
  30. package/harness/skills/performance.md +1 -0
  31. package/harness/skills/pi-todo-adapted.md +1 -0
  32. package/harness/skills/planning-tasks.md +1 -0
  33. package/harness/skills/prototype.md +2 -1
  34. package/harness/skills/research.md +1 -0
  35. package/harness/skills/resolving-merge-conflicts.md +2 -1
  36. package/harness/skills/scope-discipline.md +1 -0
  37. package/harness/skills/self-review.md +1 -0
  38. package/harness/skills/stuck-protocol.md +2 -1
  39. package/harness/skills/tdd.md +1 -0
  40. package/harness/skills/testing-infra.md +1 -0
  41. package/harness/skills/writing-skills.md +2 -1
  42. package/package.json +1 -1
  43. package/src/core/brief.ts +57 -2
  44. package/src/core/skills.ts +386 -0
  45. package/src/core/skillsAudit.ts +223 -0
  46. package/src/core/types.ts +2 -0
  47. package/harness/skills/README.md +0 -60
  48. package/harness/skills/building-mcp-servers.md +0 -70
@@ -1,70 +0,0 @@
1
- ---
2
- name: building-mcp-servers
3
- description: When and how to build a project MCP server — scaffold, handlers, self-test, register
4
- tags: [meta, mcp, server, protocol, stdio, integration, build]
5
- when: a needed external-system integration has no existing MCP server
6
- phases: []
7
- provenance: { origin: built-in }
8
- ---
9
-
10
- # Building MCP Servers
11
-
12
- ## Build vs. script — decide first
13
-
14
- - Capability is **reused across sessions/tasks** and benefits from being a
15
- native agent tool → build an MCP server.
16
- - **One-off or shell-shaped** action → a tool script is cheaper
17
- (`building-tools.md`). Don't build a server to wrap one command.
18
-
19
- ## Process
20
-
21
- 1. **Scaffold** (a WORKING server — protocol plumbing done):
22
-
23
- ```
24
- infinity-harness capability create mcp <name>
25
- → harness/mcp/<name>/server.mjs + self-test.mjs
26
- ```
27
-
28
- 2. **Define tools.** Edit the `TOOLS` object in `server.mjs`. Per tool:
29
- - `description` written FOR the consuming model — say when to call it
30
- and what comes back
31
- - `inputSchema` — JSON Schema; mark required params
32
- - `handler(args)` — async, returns a string
33
- Keep it zero-dep if possible; if you need a client library, add it to
34
- the project and pin the version.
35
-
36
- 3. **Self-test until green:**
37
-
38
- ```
39
- node harness/mcp/<name>/self-test.mjs
40
- ```
41
-
42
- It runs initialize → tools/list → tools/call. Extend it with one call
43
- per real tool you added.
44
-
45
- 4. **Register** (adds it to the index AND every MCP client config):
46
-
47
- ```
48
- infinity-harness capability add mcp <name> --command node \
49
- --args harness/mcp/<name>/server.mjs \
50
- --tags db,postgres --description "Query the dev database" --trust curated
51
- ```
52
-
53
- ## Rules
54
-
55
- - **stdout is the protocol.** Never `console.log` in a handler — one stray
56
- line corrupts the JSON-RPC stream. Log to stderr if you must.
57
- - **Secrets via environment** (`process.env.X`), never hardcoded, never in
58
- client configs.
59
- - **Handlers fail soft:** return an error message string, don't throw the
60
- server down.
61
- - **Errors are content.** A tool that errors should return actionable text
62
- ("connection refused on :5432 — is the dev DB running?").
63
-
64
- ## Checklist
65
-
66
- - [ ] Self-test green, one case per tool
67
- - [ ] No stdout pollution (run self-test — parse errors reveal it)
68
- - [ ] Secrets via env; version pins for any deps
69
- - [ ] Registered with tags + description (matcher-visible)
70
- - [ ] `infinity-harness capability doctor --type mcp` passes