harness-everything 0.2.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 (169) hide show
  1. package/AGENTS.md +2 -0
  2. package/BENCHMARK_SOP.md +62 -0
  3. package/CHANGELOG.md +107 -0
  4. package/Dockerfile +18 -0
  5. package/LICENSE +201 -0
  6. package/README.md +197 -0
  7. package/VERIFICATION.md +347 -0
  8. package/bin/cli.js +97 -0
  9. package/build-multi-agent-system/AGENTS.md +50 -0
  10. package/build-multi-agent-system/README.md +63 -0
  11. package/build-multi-agent-system/SKILL.md +68 -0
  12. package/create-agent-launcher/SKILL.md +48 -0
  13. package/create-agent-launcher/examples/csharp-monorepo.md +123 -0
  14. package/create-agent-launcher/examples/typescript-cli.md +126 -0
  15. package/create-agent-launcher/guidelines/platform-claude.md +77 -0
  16. package/create-agent-launcher/guidelines/platform-codex.md +146 -0
  17. package/create-agent-launcher/guidelines/platform-copilot.md +74 -0
  18. package/create-agent-launcher/guidelines/platform-gemini.md +101 -0
  19. package/create-agent-launcher/guidelines/role-capabilities.md +108 -0
  20. package/create-agent-launcher/templates/README.md +17 -0
  21. package/create-agent-launcher/templates/agent-launcher.md +68 -0
  22. package/create-agent-launcher/templates/backend-developer-csharp.md +56 -0
  23. package/create-agent-launcher/templates/backend-developer-polyglot.md +62 -0
  24. package/create-agent-launcher/templates/backend-developer-ts.md +57 -0
  25. package/create-agent-launcher/templates/memory-keeper.md +37 -0
  26. package/create-agent-launcher/templates/requirement-analyzer.md +66 -0
  27. package/create-agent-launcher/templates/specialist-agent.md +34 -0
  28. package/create-agent-launcher/templates/task-verifier.md +56 -0
  29. package/create-agent-launcher/templates/tool-maker.md +33 -0
  30. package/create-agent-launcher/workflows/01-init.md +22 -0
  31. package/create-agent-launcher/workflows/02-analysis.md +26 -0
  32. package/create-agent-launcher/workflows/03-generation.md +29 -0
  33. package/create-agent-launcher/workflows/04-launcher.md +20 -0
  34. package/docker-verify.sh +266 -0
  35. package/docs/architecture.md +95 -0
  36. package/docs/philosophy.md +45 -0
  37. package/docs/reflection.md +34 -0
  38. package/docs/routing.md +45 -0
  39. package/docs/workflows/build-multi-agent-system.md +62 -0
  40. package/docs/workflows/create-agent-launcher.md +62 -0
  41. package/docs/workflows/environment-detection.md +63 -0
  42. package/docs/workflows/eval-harness.md +57 -0
  43. package/docs/workflows/fable-discipline.md +59 -0
  44. package/docs/workflows/fable-mode.md +32 -0
  45. package/docs/workflows/git-commit.md +62 -0
  46. package/docs/workflows/grill-me.md +62 -0
  47. package/docs/workflows/grill-with-docs.md +62 -0
  48. package/docs/workflows/harness-everything.md +92 -0
  49. package/docs/workflows/improve-codebase-architecture.md +60 -0
  50. package/docs/workflows/install-cognitive-os.md +60 -0
  51. package/docs/workflows/repo-docs.md +59 -0
  52. package/docs/workflows/rewrite-commits.md +60 -0
  53. package/docs/workflows/security-review.md +58 -0
  54. package/docs/workflows/self-evolve.md +59 -0
  55. package/docs/workflows/skill-creator.md +75 -0
  56. package/docs/workflows/skill-style.md +64 -0
  57. package/docs/workflows/tdd.md +39 -0
  58. package/docs/workflows/todo-driven-workflow.md +36 -0
  59. package/docs/workflows/using-git-worktrees.md +63 -0
  60. package/docs/workflows/verification-loop.md +69 -0
  61. package/docs/workflows/verify-before-claim.md +60 -0
  62. package/docs/workflows/zoom-out.md +62 -0
  63. package/environment-detection/SKILL.md +77 -0
  64. package/environment-detection/scripts/preflight.js +93 -0
  65. package/eval-framework/behavioral-test.js +105 -0
  66. package/eval-framework/cases/case1.json +5 -0
  67. package/eval-framework/cases/case2.json +5 -0
  68. package/eval-framework/cases/case3.json +5 -0
  69. package/eval-framework/cases/case4-zh-tier2.json +5 -0
  70. package/eval-framework/cases/case5-zh-tier3.json +5 -0
  71. package/eval-framework/mechanism-test.js +251 -0
  72. package/eval-framework/runner.js +56 -0
  73. package/eval-harness/SKILL.md +59 -0
  74. package/eval-harness/scripts/evaluate.js +61 -0
  75. package/fable-discipline/SKILL.md +38 -0
  76. package/fable-mode/CONTRACT-FORMAT.md +51 -0
  77. package/fable-mode/SKILL.md +51 -0
  78. package/fable-mode/agents/fable-orchestrator.md +92 -0
  79. package/fable-mode/agents/fable-verifier.md +32 -0
  80. package/fable-mode/agents/fable-worker-haiku.md +48 -0
  81. package/fable-mode/agents/fable-worker-sonnet.md +49 -0
  82. package/fable-mode/execution-guardrails/SKILL.md +87 -0
  83. package/fable-mode/fable-haiku/SKILL.md +48 -0
  84. package/git-commit/SKILL.md +55 -0
  85. package/git-commit/guides/ANGULAR_STYLE.md +61 -0
  86. package/git-commit/guides/COMMIT_GENERATION.md +24 -0
  87. package/git-commit/guides/LANGUAGE_DETECTION.md +16 -0
  88. package/git-commit/guides/MAIN_REPO.md +15 -0
  89. package/git-commit/guides/SUBMODULES.md +27 -0
  90. package/grill-me/SKILL.md +36 -0
  91. package/grill-with-docs/ADR-FORMAT.md +47 -0
  92. package/grill-with-docs/CONTEXT-FORMAT.md +63 -0
  93. package/grill-with-docs/SKILL.md +99 -0
  94. package/harness-everything/SKILL.md +141 -0
  95. package/harness-everything/examples/README.md +9 -0
  96. package/harness-everything/examples/todo-workflow.md +22 -0
  97. package/harness-everything/scripts/bootstrap.js +140 -0
  98. package/harness-everything/scripts/self-heal.js +189 -0
  99. package/harness-everything/scripts/tier-router.js +219 -0
  100. package/harness-everything/scripts/todo-cli.js +157 -0
  101. package/harness-everything/scripts/verify-gate.js +31 -0
  102. package/hooks/hooks.json +155 -0
  103. package/hooks/scripts/atomic-commit-check.js +68 -0
  104. package/hooks/scripts/boundary-guard.js +55 -0
  105. package/hooks/scripts/context-compact.js +114 -0
  106. package/hooks/scripts/contract-test.js +79 -0
  107. package/hooks/scripts/depth-guard.js +65 -0
  108. package/hooks/scripts/lib/harness-state.js +202 -0
  109. package/hooks/scripts/lib/platforms/claude.js +42 -0
  110. package/hooks/scripts/lib/platforms/codex.js +46 -0
  111. package/hooks/scripts/lib/platforms/continue.js +41 -0
  112. package/hooks/scripts/lib/platforms/copilot.js +41 -0
  113. package/hooks/scripts/lib/platforms/cursor.js +41 -0
  114. package/hooks/scripts/lib/platforms/hermes.js +32 -0
  115. package/hooks/scripts/lib/platforms/index.js +17 -0
  116. package/hooks/scripts/lib/platforms/worktrees.js +20 -0
  117. package/hooks/scripts/reset-circuit-breaker.js +30 -0
  118. package/hooks/scripts/rule-of-3-tracker.js +91 -0
  119. package/hooks/scripts/rule-of-3.js +176 -0
  120. package/hooks/scripts/state-persist.js +99 -0
  121. package/hooks/scripts/stop-gate.js +80 -0
  122. package/hooks/scripts/subagent-scope-guard.js +88 -0
  123. package/improve-codebase-architecture/SKILL.md +44 -0
  124. package/improve-codebase-architecture/guides/DEEPENING.md +37 -0
  125. package/improve-codebase-architecture/guides/HTML-REPORT.md +123 -0
  126. package/improve-codebase-architecture/guides/INTERFACE-DESIGN.md +44 -0
  127. package/improve-codebase-architecture/guides/LANGUAGE.md +53 -0
  128. package/install-cognitive-os/SKILL.md +95 -0
  129. package/package.json +22 -0
  130. package/repo-docs/SKILL.md +45 -0
  131. package/repo-docs/templates/agents-template.md +264 -0
  132. package/repo-docs/templates/knowledge-agents-template.md +50 -0
  133. package/repo-docs/templates/knowledge-readme-template.md +83 -0
  134. package/repo-docs/templates/manual-recon.md +117 -0
  135. package/repo-docs/templates/multi-skills-readme-template.md +72 -0
  136. package/repo-docs/templates/product-agents-template.md +78 -0
  137. package/repo-docs/templates/product-readme-template.md +95 -0
  138. package/repo-docs/templates/readme-template.md +136 -0
  139. package/repo-docs/templates/single-skill-readme-template.md +70 -0
  140. package/repo-docs/templates/skills-agents-template.md +60 -0
  141. package/rewrite-commits/SKILL.md +32 -0
  142. package/scripts/installer.js +649 -0
  143. package/scripts/lib/advisory-text.js +163 -0
  144. package/scripts/lib/claude-hooks.js +71 -0
  145. package/scripts/lib/gitignore.js +58 -0
  146. package/scripts/lib/manifest.js +82 -0
  147. package/scripts/lib/prompts.js +241 -0
  148. package/scripts/lib/skills.js +172 -0
  149. package/scripts/lib/workspace.js +28 -0
  150. package/security-review/SKILL.md +511 -0
  151. package/self-evolve/SKILL.md +54 -0
  152. package/self-evolve/scripts/persist-memory.js +40 -0
  153. package/self-evolve/scripts/self-regression.js +113 -0
  154. package/skill-creator/SKILL.md +91 -0
  155. package/skill-creator/references/quality-principles.md +81 -0
  156. package/skill-creator/references/testing-workflow.md +32 -0
  157. package/skill-style/SKILL.md +48 -0
  158. package/skill-style/STYLE.md +37 -0
  159. package/tdd/SKILL.md +53 -0
  160. package/tdd/guides/deep-modules.md +33 -0
  161. package/tdd/guides/interface-design.md +31 -0
  162. package/tdd/guides/mocking.md +59 -0
  163. package/tdd/guides/refactoring.md +10 -0
  164. package/tdd/guides/tests.md +61 -0
  165. package/todo-driven-workflow/SKILL.md +54 -0
  166. package/using-git-worktrees/SKILL.md +161 -0
  167. package/verification-loop/SKILL.md +138 -0
  168. package/verify-before-claim/SKILL.md +86 -0
  169. package/zoom-out/SKILL.md +90 -0
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: create-agent-launcher
3
+ description: Sub-agent generator for orchestrating multi-domain specialized agents to avoid token waste.
4
+ author: Miya Daniel | Harness Core Team
5
+ version: 0.2.0
6
+ ---
7
+
8
+ # Create Agent Launcher
9
+
10
+ ## 📋 Skill Contract
11
+
12
+ | Component | Specification |
13
+ | :--- | :--- |
14
+ | **Trigger / Input** | Invoked by `fable-mode` for Tier 3 tasks needing domain-specific division of labor — task complexity exceeds a single context, or spans disjoint tech stacks. |
15
+ | **Expected Output** | One or more sub-agents launched with an explicit persona, a resource-isolated scope (only the file paths relevant to their task), and a model-tier assignment (Haiku / Sonnet / Opus by sub-task complexity). |
16
+ | **State Mutations** | None directly to files — mutates the active session's delegation state (which sub-agents are live, what each was briefed to touch). |
17
+ | **Enforcement Gate** | Every sub-agent MUST return a structured handoff report (files modified, new APIs/interfaces exposed, downstream concerns) before its output is trusted. Creating a sub-agent is **PROHIBITED** if the task fits in ≤2 files / ≤300 lines — resolve directly under `tdd` instead. |
18
+
19
+ This skill is automatically invoked by `fable-mode` when handling Tier 3 (Macro Tasks) that require domain-specific division of labor.
20
+ Its purpose is to avoid wasting Tokens and losing attention caused by a single General Agent handling everything, by creating highly specialized Sub-agents to solve complex problems.
21
+
22
+ ## 1. Responsibilities and Use Cases
23
+ Launch this skill when the task complexity exceeds what a single context can handle, or when switching between entirely different tech stacks is necessary (e.g., the same feature requires modifying Postgres Schema, Node.js Backend, and React Frontend).
24
+
25
+ ## 2. Standard Procedure for Creating Sub-agents
26
+
27
+ ### Step 1: Persona Definition
28
+ Before calling a secondary model (or instantiating a new Agent), you MUST explicitly give it a specialized persona definition.
29
+ - **Bad Example**: "Help me fix these frontend and backend codes."
30
+ - **Good Example**: "You are now a Senior Database Architect. Your sole task is to optimize the indexing and write performance of the User Table for this requirement. You are PROHIBITED from modifying any frontend code."
31
+
32
+ ### Step 2: Resource Isolation
33
+ - Limit the Sub-agent's field of view. Only provide it with the file paths and Context necessary to complete its task.
34
+ - Do not feed the entire project structure to an Agent that is only responsible for writing a single SQL Migration.
35
+
36
+ ### Step 3: Model Selection Strategy
37
+ Based on the complexity of the sub-task, select the most cost-effective model (assuming the underlying Harness supports switching):
38
+ - **Exploration/Finding Files/Simple Edits**: Assign to a fast, low-cost small model (like Claude 3.5 Haiku).
39
+ - **Multi-file Implementation/General Logic**: Assign to a medium-sized main model (like Claude 3.5 Sonnet).
40
+ - **Extremely Complex Algorithms/Security Audits**: Assign to a deep reasoning model (like Claude 3 Opus).
41
+
42
+ ### Step 4: Handoff Contract
43
+ - Tell the Sub-agent that once it completes its task, it MUST output a report in a specific format to the main Orchestrator (`fable-mode`).
44
+ - The report MUST include: which files were modified, what new APIs/interfaces were exposed, and what downstream Agents need to pay attention to.
45
+
46
+ ## 3. Foolproofing Mechanism
47
+ - Avoid over-segmentation: If a cross-stack task can be resolved within 2 files and 300 lines of code, establishing a Sub-agent is **PROHIBITED**. Resolve it directly in the current Context using `tdd` mode.
48
+ - Sub-agents are also Agents, equally bound by the `install-cognitive-os` physical laws and the `zoom-out` circuit breaker.
@@ -0,0 +1,123 @@
1
+ ---
2
+ description: "Output example for create-agent-launcher applied to a fictional C# super-monorepo project (Contoso Workbench). Shows the Context Profile from project discovery and the expected generated agent content."
3
+ ---
4
+
5
+ # Example: C# Super-Monorepo (Contoso Workbench)
6
+
7
+ This example shows what the Project Discovery step should extract from the project, and what the generated agent files should contain. **Contoso Workbench is a fictional project** — substitute your own project's real names, paths, and build commands.
8
+
9
+ ---
10
+
11
+ ## Input: Project Discovery Findings
12
+
13
+ After reading `README.md`, `AGENTS.md` (or `.github/copilot-instructions.md`), and `.gitmodules`, the LLM should record this Context Profile:
14
+
15
+ ```
16
+ Project Name: Contoso Workbench
17
+ Primary Language: C# (.NET Framework 4.7.2)
18
+ Full Build Command: dotnet build Workbench.App/Workbench.App/WorkbenchApp.csproj (or via ./compile)
19
+ Local Build Command:dotnet build <specific.csproj> inside the affected submodule
20
+ Key Source Paths: Workbench.App/Workbench.App/ (main desktop app), Workbench.Common/ (shared utils),
21
+ Workbench.VcsBridge/ (VCS integration), Workbench.Reporting/ (report engine)
22
+ AI Plan Path: docs/ai_plans/ at the MAIN REPO ROOT (not inside submodules)
23
+ Monorepo Type: git submodules (level-1 only)
24
+ Workspace File: Workbench.sln
25
+ Special Constraints:Source code MUST live in submodules — never commit source to the main repo.
26
+ Each submodule must be level-1.
27
+ ```
28
+
29
+ **Key signals discovered from README.md:**
30
+ - "In the super project, only solution file (.sln), cmake list and other collective control files are placed, and **no source code is allowed**."
31
+ - "All reference projects in the super project must be located under the git submodule."
32
+ - List of submodule directories: `Workbench.App/`, `Workbench.Common/`, `Workbench.VcsBridge/`, `Workbench.Reporting/`, etc.
33
+
34
+ ---
35
+
36
+ ## Output: Generated Agent Files
37
+
38
+ **`requirement-analyzer.agent.md` — Approach section:**
39
+ ```markdown
40
+ ## Approach
41
+
42
+ 1. **Analyze Requirements**: Review the requirements. Use `search` and `read` tools to
43
+ gather context from the relevant submodule(s): `Workbench.App/Workbench.App/` (main app
44
+ project), `Workbench.Common/` (shared utilities), `Workbench.VcsBridge/` (VCS
45
+ integration), and others as applicable. All source code lives in level-1 git
46
+ submodules — never in the main repo.
47
+ 2. **Handle Ambiguities**: Note critical ambiguities for the user; otherwise proceed.
48
+ 3. **Document**: Save a detailed implementation document at the **main repo root** as
49
+ `docs/ai_plans/implement_<feature-name>.md`
50
+ (e.g., `docs/ai_plans/implement_vcs_tag_merge_support.md`). Include:
51
+ - Implementation Goals
52
+ - Approach / Methodology
53
+ - Detailed Implementation Steps
54
+ - Implementation Details (classes, APIs, files, submodule paths)
55
+ - Architecture Diagrams (if applicable)
56
+ ```
57
+
58
+ **`backend-developer.agent.md` — full file:**
59
+ ```markdown
60
+ ---
61
+ name: "Backend Developer"
62
+ description: "Use when: you need to implement C# source code based on a requirement list or AI plan. This agent implements features and verifies them using 'dotnet build'."
63
+ tools: [read, edit, search, execute]
64
+ ---
65
+
66
+ You are an expert C# Backend Developer working in the **Contoso Workbench** solution.
67
+ Your primary responsibility is to implement C# source code strictly based on a
68
+ provided requirement list or AI implementation document.
69
+
70
+ ## Approach
71
+
72
+ 1. **Analyze Requirements**: Read the provided implementation document in
73
+ `docs/ai_plans/`. Use `search` and `read` to understand the existing C# codebase
74
+ in the relevant submodule(s): `Workbench.App/Workbench.App/`, `Workbench.Common/`,
75
+ `Workbench.VcsBridge/`.
76
+ 2. **Review Codebase (MANDATORY)**: Before making ANY modifications, read all source
77
+ files that will be affected.
78
+ 3. **Implement**: Use the `edit` tool to modify or create C# source code inside the
79
+ appropriate submodule. Do NOT add source files to the main repo.
80
+ 4. **Verify via Compilation — choose minimum scope**:
81
+ - **Step 1 — Assess scope**: Did you only change private/internal code within a single `.csproj`
82
+ (method bodies, private fields, internal classes)? → **Local build**.
83
+ Did you change a public/protected API, an interface, an enum, or a `.csproj` dependency? → **Cross-project build**.
84
+ - **Local build** (single project, fastest): `dotnet build <changed-project>.csproj`
85
+ inside the affected submodule (e.g., `dotnet build Workbench.VcsBridge/VcsBridge/VcsBridge.csproj`).
86
+ - **Cross-project build** (when public API changes may break dependents):
87
+ `dotnet build Workbench.App/Workbench.App/WorkbenchApp.csproj`
88
+ - Prefer local build first. Escalate to cross-project only when the assessment above requires it.
89
+
90
+ ## Constraints
91
+
92
+ - DO NOT modify the requirements. Your job is strictly implementation.
93
+ - ALWAYS ensure the code compiles successfully before considering your task complete.
94
+ - Fix all compiler errors before finishing.
95
+ - All source code changes MUST be made inside the relevant submodule — never in the main repo.
96
+ ```
97
+
98
+ **`agent-launcher/SKILL.md` — Project-Specific Notes section:**
99
+ ```markdown
100
+ ## Project-Specific Notes
101
+
102
+ - **Build verification**: `dotnet build Workbench.App/Workbench.App/WorkbenchApp.csproj`
103
+ (or scope to specific `.csproj` for isolated changes)
104
+ - **AI plan documents**: Save at `docs/ai_plans/implement_<name>.md` at the **main repo root**
105
+ (repo-root-relative — never an absolute disk path, and never inside a submodule)
106
+ - **Primary language**: C# (.NET Framework 4.7.2)
107
+ - **Monorepo notes**: Super monorepo — all source code lives in level-1 git submodules
108
+ (`Workbench.App/`, `Workbench.Common/`, `Workbench.VcsBridge/`, etc.). Never commit
109
+ source to the main repo.
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Key Specificity Points
115
+
116
+ | Element | Expected in Generated Agent |
117
+ |---------|-----------------------------|
118
+ | Source paths | `Workbench.App/Workbench.App/`, `Workbench.Common/`, `Workbench.VcsBridge/` (with role annotations) |
119
+ | AI plan location | `docs/ai_plans/` **at the main repo root** — explicitly, not inside submodules |
120
+ | Path style | Always repo-root-relative — generated agents must never contain absolute disk paths |
121
+ | Architecture constraint | "Never add source files to the main repo" |
122
+ | Build scope decision | Assess scope first; prefer `dotnet build <X.csproj>` before escalating to solution-wide |
123
+ | Project identity | "the **Contoso Workbench** solution" |
@@ -0,0 +1,126 @@
1
+ ---
2
+ description: "Output example for create-agent-launcher applied to a fictional TypeScript npm-workspaces monorepo CLI project (Acme CLI). Shows the Context Profile from project discovery and the expected generated agent content."
3
+ ---
4
+
5
+ # Example: TypeScript npm Monorepo CLI (Acme CLI)
6
+
7
+ This example shows what the Project Discovery step should extract from the project, and what the generated agent files should contain. **Acme CLI is a fictional project** — substitute your own project's real names, paths, and build commands.
8
+
9
+ ---
10
+
11
+ ## Input: Project Discovery Findings
12
+
13
+ After reading `README.md`, `AGENTS.md` (project-specific AI notes), and `package.json`, the LLM should record this Context Profile:
14
+
15
+ ```
16
+ Project Name: Acme CLI
17
+ Primary Language: TypeScript / Node.js
18
+ Full Build Command: npm run build (runs scripts/build.sh across all packages)
19
+ Local Build Command:npm run build -w packages/<package-name>
20
+ Key Source Paths: packages/core/src/ (core agent logic),
21
+ packages/cli/src/ (CLI entry point and commands),
22
+ packages/vscode-companion/ (VSCode integration)
23
+ AI Plan Path: docs/ai_plans/ at the repo root
24
+ Monorepo Type: npm workspaces
25
+ Workspace File: package.json (workspaces: ["packages/*"])
26
+ Special Constraints:Run 'npm run lint' after build. Integration tests in integration-tests/.
27
+ ```
28
+
29
+ **Key signals discovered from README.md and package.json:**
30
+ - `"workspaces": ["packages/*"]` → npm workspaces monorepo
31
+ - `"build": "scripts/build.sh"` → custom build script (not bare `tsc`)
32
+ - `"lint": "eslint ."` → ESLint configured
33
+ - Packages: `@acme/cli` (CLI entry), `@acme/cli-core` (core logic)
34
+ - TypeScript config at root `tsconfig.json` and per-package
35
+
36
+ ---
37
+
38
+ ## Output: Generated Agent Files
39
+
40
+ **`requirement-analyzer.agent.md` — Approach section:**
41
+ ```markdown
42
+ ## Approach
43
+
44
+ 1. **Analyze Requirements**: Review the requirements. Use `search` and `read` tools to
45
+ gather context from the relevant packages: `packages/core/src/` (core logic, tools,
46
+ and model integration), `packages/cli/src/` (CLI entry point, commands, and REPL),
47
+ and `packages/vscode-companion/` (VSCode companion extension) as applicable.
48
+ 2. **Handle Ambiguities**: Note critical ambiguities for the user; otherwise proceed.
49
+ 3. **Document**: Save a detailed implementation document at `docs/ai_plans/` as
50
+ `implement_<feature-name>.md` (e.g., `docs/ai_plans/implement_cli_auth.md`).
51
+ Include:
52
+ - Implementation Goals
53
+ - Approach / Methodology
54
+ - Detailed Implementation Steps
55
+ - Implementation Details (classes, APIs, files, package paths)
56
+ - Architecture Diagrams (if applicable)
57
+ ```
58
+
59
+ **`backend-developer.agent.md` — full file:**
60
+ ```markdown
61
+ ---
62
+ name: "Backend Developer"
63
+ description: "Use when: you need to implement TypeScript/Node.js source code based on a requirement list or AI plan. This agent implements features and verifies them using 'npm run build'."
64
+ tools: [read, edit, search, execute]
65
+ ---
66
+
67
+ You are an expert TypeScript/Node.js Developer working in the **Acme CLI** monorepo.
68
+ Your primary responsibility is to implement TypeScript source code strictly based on a
69
+ provided requirement list or AI implementation document.
70
+
71
+ ## Approach
72
+
73
+ 1. **Analyze Requirements**: Read the provided implementation document in `docs/ai_plans/`.
74
+ Use `search` and `read` to understand the existing codebase in the relevant packages:
75
+ `packages/core/src/` (core logic and tools), `packages/cli/src/` (CLI commands
76
+ and REPL), and `packages/vscode-companion/` (VSCode integration).
77
+ 2. **Review Codebase (MANDATORY)**: Before making ANY modifications, read all source
78
+ files that will be affected.
79
+ 3. **Implement**: Use the `edit` tool to modify or create TypeScript source code.
80
+ 4. **Verify via Compilation/Linting — choose minimum scope**:
81
+ - **Step 1 — Assess scope**: Did you only change files inside a single package (e.g., only
82
+ `packages/cli/src/`)? → **Local build**. Did you change a shared type, a public export
83
+ from `packages/core/`, or a root-level config? → **Full workspace build**.
84
+ - **Local build** (single package, fastest):
85
+ `npm run build -w packages/<package-name>`
86
+ (e.g., `npm run build -w packages/cli`)
87
+ - **Full workspace build** (when shared exports or cross-package types change):
88
+ `npm run build` (runs the full `scripts/build.sh` pipeline)
89
+ - **After any build**: Run `npm run lint` to ensure linting passes.
90
+ - Prefer local build first. Escalate to full workspace only when the assessment above requires it.
91
+
92
+ ## Constraints
93
+
94
+ - DO NOT modify the requirements. Your job is strictly implementation.
95
+ - You MUST thoroughly read all relevant existing files before writing any code.
96
+ - ALWAYS ensure the code compiles and lint passes before considering your task complete.
97
+ - Fix all compilation and lint errors before finishing.
98
+ ```
99
+
100
+ **`agent-launcher/SKILL.md` — Project-Specific Notes section:**
101
+ ```markdown
102
+ ## Project-Specific Notes
103
+
104
+ - **Build verification**: `npm run build` (full workspace via `scripts/build.sh`)
105
+ or `npm run build -w packages/<name>` for a single package
106
+ - **Lint**: Always run `npm run lint` after build
107
+ - **AI plan documents**: Save at `docs/ai_plans/implement_<name>.md` (or `fix_<name>.md`),
108
+ repo-root-relative — never an absolute disk path
109
+ - **Primary language**: TypeScript / Node.js
110
+ - **Monorepo notes**: npm workspaces (`packages/*`). Key packages:
111
+ `packages/core` (`@acme/cli-core`) and `packages/cli` (`@acme/cli`).
112
+ Integration tests live in `integration-tests/`.
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Key Specificity Points
118
+
119
+ | Element | Expected in Generated Agent |
120
+ |---------|-----------------------------|
121
+ | Source paths | `packages/core/src/` (core logic), `packages/cli/src/` (CLI commands), with role annotations |
122
+ | Path style | Always repo-root-relative — generated agents must never contain absolute disk paths |
123
+ | Build scope decision | Assess scope first; prefer `npm run build -w packages/<name>` before escalating to full build |
124
+ | Lint requirement | Explicit: always run `npm run lint` after any build |
125
+ | Package identity | `@acme/cli-core` and `@acme/cli` (not just "the workspace") |
126
+ | AI plan example | `docs/ai_plans/implement_cli_auth.md` (real naming pattern) |
@@ -0,0 +1,77 @@
1
+ ---
2
+ description: "Platform guidelines for generating agent scaffolds targeting Claude Code (Anthropic CLI). Covers naming, tool declarations, directory layout, and interaction mechanisms."
3
+ ---
4
+
5
+ # Platform Guidelines: Claude Code (Anthropic CLI)
6
+
7
+ ## Naming Convention
8
+
9
+ - Agent names must use **lowercase with hyphens** (e.g., `requirement-analyzer`, `backend-developer`).
10
+ - No spaces allowed in agent names or identifiers.
11
+ - File names follow the same convention (e.g., `requirement-analyzer.md`).
12
+
13
+ ## Tools Declaration
14
+
15
+ Use Claude Code's exact tool name strings as a YAML array:
16
+
17
+ ```yaml
18
+ tools: ["Read", "Edit", "Glob", "Grep", "Bash", "AskUserQuestion"]
19
+ ```
20
+
21
+ When generating agent files from templates, substitute the placeholders as follows:
22
+ - `{{TOOLS_ARRAY_DECLARATION}}`: `tools: ["Read", "Edit", "Glob", "Grep", "Bash", "AskUserQuestion"]` (exclude `"Bash"` for Requirement Analyzer)
23
+ - `{{READ_TOOL_NAME}}`: `"Read"`
24
+ - `{{EDIT_TOOL_NAME}}`: `"Edit"`
25
+ - `{{SEARCH_TOOL_NAME}}`: `"Glob" and "Grep"`
26
+ - `{{EXECUTE_TOOL_NAME}}`: `"Bash"`
27
+
28
+ > **CRITICAL RULE — AskUserQuestion is MANDATORY**: When generating a **restricted** tool list (i.e., any list that does not include all tools), you MUST always include `"AskUserQuestion"` in the array. If this tool is omitted, the agent will lose the ability to ask clarifying questions and will enter a **deadlock state** — unable to proceed or request help.
29
+
30
+ ## Directory Layout
31
+
32
+ | Artifact | Path |
33
+ |----------|------|
34
+ | Agent definitions | `.claude/agents/*.md` |
35
+ | Output styles | `.claude/output-styles/` |
36
+ | System prompt | `CLAUDE.md` (project root) |
37
+ | Global config | `~/.claude/output-styles/` |
38
+
39
+ Default target directory is `.claude/`.
40
+
41
+ ## User Interaction Mechanism
42
+
43
+ Use the built-in `AskUserQuestion` tool to pause the agent loop and prompt the user:
44
+
45
+ ```
46
+ AskUserQuestion(
47
+ question: "Where should the agent scaffold be created?",
48
+ options: [".claude/ (default)", "Custom path"]
49
+ )
50
+ ```
51
+
52
+ This renders as an interactive prompt in the CLI terminal, blocking execution until the user responds.
53
+
54
+ ## System Prompt / Instructions File
55
+
56
+ After generating agents, ensure `CLAUDE.md` at the project root contains the orchestrator rules. If `CLAUDE.md` does not exist, create it with the State Machine block.
57
+
58
+ ## Agent File Format
59
+
60
+ Plain Markdown files under `.claude/agents/`:
61
+
62
+ ```markdown
63
+ # requirement-analyzer
64
+
65
+ **Role**: Requirement Analyzer
66
+ **Tools**: Read, Edit, Glob, Grep, AskUserQuestion
67
+
68
+ You are an expert AI Architect...
69
+
70
+ ## Constraints
71
+ ...
72
+
73
+ ## Approach
74
+ ...
75
+ ```
76
+
77
+ YAML frontmatter is optional in Claude agents; use a `# heading` and `**field**:` pattern instead if preferred.
@@ -0,0 +1,146 @@
1
+ ---
2
+ description: "Platform guidelines for generating agent scaffolds targeting Codex / Custom API environments. Covers naming, OpenAI Tool Spec / JSON Schema format, directory layout, and custom ask_user function calling."
3
+ ---
4
+
5
+ # Platform Guidelines: Codex / Custom API Environment
6
+
7
+ ## Naming Convention
8
+
9
+ - Follow system variable / key-value naming conventions (e.g., `requirement_analyzer`, `backend_developer`).
10
+ - Use lowercase with underscores or hyphens; avoid spaces.
11
+ - Names serve as JSON object keys — they must be valid identifiers in most languages.
12
+
13
+ ## Tools Declaration
14
+
15
+ There are **no built-in tools**. All tools must be defined using the **OpenAI Tool Spec (JSON Schema)** format and implemented in your local orchestrator code.
16
+
17
+ When generating agent files from templates (if not using pure JSON), substitute the placeholders as follows:
18
+ - `{{TOOLS_ARRAY_DECLARATION}}`: *(Leave empty in Markdown, handled via JSON configuration)*
19
+ - `{{READ_TOOL_NAME}}`: `read_file`
20
+ - `{{EDIT_TOOL_NAME}}`: `write_file`
21
+ - `{{SEARCH_TOOL_NAME}}`: `search`
22
+ - `{{EXECUTE_TOOL_NAME}}`: `execute_command`
23
+
24
+ Each agent definition includes a `tools` array of JSON Schema objects:
25
+
26
+ ```json
27
+ {
28
+ "agents": {
29
+ "requirement_analyzer": {
30
+ "name": "requirement_analyzer",
31
+ "description": "Analyzes user requirements and creates implementation documents.",
32
+ "tools": [
33
+ {
34
+ "type": "function",
35
+ "function": {
36
+ "name": "read_file",
37
+ "description": "Read a file from the project.",
38
+ "parameters": {
39
+ "type": "object",
40
+ "properties": {
41
+ "path": { "type": "string", "description": "File path to read." }
42
+ },
43
+ "required": ["path"]
44
+ }
45
+ }
46
+ },
47
+ {
48
+ "type": "function",
49
+ "function": {
50
+ "name": "ask_user",
51
+ "description": "Pause the agent loop and ask the user a question.",
52
+ "parameters": {
53
+ "type": "object",
54
+ "properties": {
55
+ "question": { "type": "string" },
56
+ "options": {
57
+ "type": "array",
58
+ "items": { "type": "string" }
59
+ }
60
+ },
61
+ "required": ["question"]
62
+ }
63
+ }
64
+ }
65
+ ]
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ## Directory Layout
72
+
73
+ All paths are **custom** — defined by the local orchestrator implementation:
74
+
75
+ | Artifact | Suggested Path |
76
+ |----------|---------------|
77
+ | Agent definitions | `config/agents/*.json` or `config/agents.json` |
78
+ | System prompt | `config/system_prompt.txt` |
79
+ | Tool schemas | `config/tools/*.json` |
80
+ | Global config | `~/.config/myapp/` or as defined by your app |
81
+
82
+ Default target directory is `config/`.
83
+
84
+ ## User Interaction Mechanism
85
+
86
+ There is **no built-in confirmation mechanism**. Implement a custom `ask_user` function tool that follows the OpenAI Function Calling / Tool Use pattern:
87
+
88
+ 1. The agent calls `ask_user` with a `question` and optional `options`.
89
+ 2. The API returns the function call in its response.
90
+ 3. Your **local orchestrator code** intercepts the call, renders the UI (terminal prompt, web form, etc.), and submits the user's answer back as a tool result.
91
+ 4. The agent resumes execution.
92
+
93
+ The `ask_user` schema should mirror `vscode_askQuestions` for portability:
94
+
95
+ ```json
96
+ {
97
+ "type": "function",
98
+ "function": {
99
+ "name": "ask_user",
100
+ "description": "Ask the user a question and wait for their response before continuing.",
101
+ "parameters": {
102
+ "type": "object",
103
+ "properties": {
104
+ "header": { "type": "string", "description": "Short identifier for the question." },
105
+ "question": { "type": "string", "description": "The question to ask." },
106
+ "options": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "object",
110
+ "properties": {
111
+ "label": { "type": "string" },
112
+ "recommended": { "type": "boolean" }
113
+ },
114
+ "required": ["label"]
115
+ }
116
+ },
117
+ "allowFreeformInput": { "type": "boolean", "default": true }
118
+ },
119
+ "required": ["header", "question"]
120
+ }
121
+ }
122
+ }
123
+ ```
124
+
125
+ ## System Prompt / Instructions File
126
+
127
+ The system prompt format is fully custom. Suggested location: `config/system_prompt.txt` or `config/system_prompt.md`. Include the orchestrator rules adapted for your API loop implementation.
128
+
129
+ ## Agent File Format
130
+
131
+ Agent definitions are typically JSON objects:
132
+
133
+ ```json
134
+ {
135
+ "name": "requirement_analyzer",
136
+ "description": "Analyzes requirements and creates implementation documents.",
137
+ "system_prompt": "You are an expert AI Architect...",
138
+ "tools": ["read_file", "edit_file", "ask_user"],
139
+ "constraints": [
140
+ "DO NOT implement features yourself.",
141
+ "ALWAYS create a structured implementation document first."
142
+ ]
143
+ }
144
+ ```
145
+
146
+ Implement `read_file`, `edit_file`, and all other tools referenced in `tools` arrays in your orchestrator's backend code.
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: "Platform guidelines for generating agent scaffolds targeting GitHub Copilot (VS Code). Covers naming, tool declarations, directory layout, and interaction mechanisms."
3
+ ---
4
+
5
+ # Platform Guidelines: GitHub Copilot (VS Code)
6
+
7
+ ## Naming Convention
8
+
9
+ - Agent names are **flexible** — spaces, Chinese characters, and mixed case are allowed.
10
+ - Recommended style: Title Case with spaces (e.g., `Requirement Analyzer`, `Backend Developer`).
11
+ - File names use kebab-case (e.g., `requirement-analyzer.agent.md`).
12
+
13
+ ## Tools Declaration
14
+
15
+ Use the VS Code-encapsulated permission names as a YAML array:
16
+
17
+ ```yaml
18
+ tools: [read, edit, search, execute]
19
+ ```
20
+
21
+ When generating agent files from templates, substitute the placeholders as follows:
22
+ - `{{TOOLS_ARRAY_DECLARATION}}`: `tools: [read, edit, search, execute]` (exclude `execute` for Requirement Analyzer)
23
+ - `{{READ_TOOL_NAME}}`: `read`
24
+ - `{{EDIT_TOOL_NAME}}`: `edit`
25
+ - `{{SEARCH_TOOL_NAME}}`: `search`
26
+ - `{{EXECUTE_TOOL_NAME}}`: `execute`
27
+
28
+ ## Directory Layout
29
+
30
+ | Artifact | Path |
31
+ |----------|------|
32
+ | Agent definitions | `<target_dir>/agents/*.agent.md` |
33
+ | Orchestrator instructions | `<target_dir>/instructions/orchestrator.instructions.md` |
34
+ | Skill entry point | `<target_dir>/skills/agent-launcher/SKILL.md` |
35
+ | System prompt | `.github/copilot-instructions.md` |
36
+ | Global config | `~/.config/github-copilot/` |
37
+
38
+ Default `<target_dir>` is `.github/`.
39
+
40
+ ## User Interaction Mechanism
41
+
42
+ Use the `vscode_askQuestions` tool to pause the workflow and prompt the user for decisions.
43
+
44
+ ```json
45
+ [{
46
+ "header": "unique_key",
47
+ "question": "Your question here?",
48
+ "options": [
49
+ { "label": "Option A", "recommended": true },
50
+ { "label": "Option B" }
51
+ ],
52
+ "allowFreeformInput": true
53
+ }]
54
+ ```
55
+
56
+ This renders as a dropdown or input box in the VS Code window.
57
+
58
+ ## System Prompt / Instructions File
59
+
60
+ After generating agents, ensure `.github/copilot-instructions.md` contains the `## 🤖 State Machine Orchestrator Instructions` block. If the file does not exist, create it.
61
+
62
+ ## Agent File Format
63
+
64
+ Standard `.agent.md` file with YAML frontmatter:
65
+
66
+ ```yaml
67
+ ---
68
+ name: "Requirement Analyzer"
69
+ description: "Use when: ..."
70
+ tools: [read, edit, search]
71
+ ---
72
+ ```
73
+
74
+ All files MUST include a YAML frontmatter `description` field for context optimization.