@jeancodogno/specforce-kit 0.1.4 → 0.1.6
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/index.js +0 -0
- package/package.json +12 -28
- package/.geminiignore +0 -15
- package/.github/workflows/ci.yml +0 -101
- package/.github/workflows/release.yml +0 -51
- package/.golangci.yml +0 -17
- package/.goreleaser.yaml +0 -39
- package/.rgignore +0 -13
- package/.specforce/config.yaml +0 -32
- package/.specforce/docs/.gitkeep +0 -0
- package/.specforce/docs/architecture.md +0 -98
- package/.specforce/docs/engineering.md +0 -80
- package/.specforce/docs/governance.md +0 -30
- package/.specforce/docs/memorial.md +0 -44
- package/.specforce/docs/principles.md +0 -31
- package/.specforce/docs/security.md +0 -31
- package/.specforce/docs/ui-ux.md +0 -129
- package/.specforce/specs/.gitkeep +0 -0
- package/AGENTS.md +0 -36
- package/CONTRIBUTING.md +0 -81
- package/Makefile +0 -49
- package/assets/logo-header.png +0 -0
- package/assets/logo.png +0 -0
- package/docs/artifacts.md +0 -41
- package/docs/cli.md +0 -73
- package/docs/configuration.md +0 -50
- package/docs/getting-started.md +0 -110
- package/docs/supported-tools.md +0 -14
- package/go.mod +0 -35
- package/go.sum +0 -61
- package/src/cmd/specforce/main.go +0 -23
- package/src/cmd/specforce/main_test.go +0 -7
- package/src/internal/agent/artifacts/constitution/architecture.yaml +0 -70
- package/src/internal/agent/artifacts/constitution/engineering.yaml +0 -52
- package/src/internal/agent/artifacts/constitution/governance.yaml +0 -41
- package/src/internal/agent/artifacts/constitution/memorial.yaml +0 -55
- package/src/internal/agent/artifacts/constitution/principles.yaml +0 -54
- package/src/internal/agent/artifacts/constitution/security.yaml +0 -47
- package/src/internal/agent/artifacts/constitution/ui-ux.yaml +0 -158
- package/src/internal/agent/artifacts/spec/design.yaml +0 -50
- package/src/internal/agent/artifacts/spec/requirements.yaml +0 -48
- package/src/internal/agent/artifacts/spec/tasks.yaml +0 -55
- package/src/internal/agent/compatibility_test.go +0 -120
- package/src/internal/agent/cwd_test.go +0 -9
- package/src/internal/agent/embed.go +0 -19
- package/src/internal/agent/integration_test.go +0 -138
- package/src/internal/agent/kit/agents/product-analyst.yaml +0 -31
- package/src/internal/agent/kit/agents/technical-developer.yaml +0 -28
- package/src/internal/agent/kit/agents/technical-project-planner.yaml +0 -30
- package/src/internal/agent/kit/agents/technical-qa-engineer.yaml +0 -36
- package/src/internal/agent/kit/agents/technical-solution-architect.yaml +0 -32
- package/src/internal/agent/kit/commands/archive.yaml +0 -25
- package/src/internal/agent/kit/commands/constitution.yaml +0 -132
- package/src/internal/agent/kit/commands/implement.yaml +0 -96
- package/src/internal/agent/kit/commands/spec.yaml +0 -94
- package/src/internal/agent/kit/instructions/archive.md +0 -68
- package/src/internal/agent/kit/kit.yaml +0 -111
- package/src/internal/agent/kit/skills/opportunity-framing/SKILL.yaml +0 -56
- package/src/internal/agent/kit/skills/pragmatic-product-owner/SKILL.yaml +0 -58
- package/src/internal/agent/kit/skills/pragmatic-product-owner/references/spec-artifacts.yaml +0 -38
- package/src/internal/agent/kit/skills/spec-clarification-interview/SKILL.yaml +0 -52
- package/src/internal/agent/kit/skills/task-atomic-decomposition/SKILL.yaml +0 -137
- package/src/internal/agent/kit/skills/task-atomic-decomposition/references/roadmap-patterns.yaml +0 -103
- package/src/internal/agent/kit_manifests_test.go +0 -58
- package/src/internal/agent/manifest.go +0 -15
- package/src/internal/agent/registry.go +0 -69
- package/src/internal/agent/registry_test.go +0 -51
- package/src/internal/agent/translator.go +0 -334
- package/src/internal/agent/translator_test.go +0 -734
- package/src/internal/cli/archive.go +0 -91
- package/src/internal/cli/archive_test.go +0 -67
- package/src/internal/cli/cli.go +0 -259
- package/src/internal/cli/cli_test.go +0 -130
- package/src/internal/cli/cobra/archive.go +0 -26
- package/src/internal/cli/cobra/console.go +0 -21
- package/src/internal/cli/cobra/constitution.go +0 -44
- package/src/internal/cli/cobra/dummy_test.go +0 -7
- package/src/internal/cli/cobra/implementation.go +0 -50
- package/src/internal/cli/cobra/init.go +0 -23
- package/src/internal/cli/cobra/install.go +0 -21
- package/src/internal/cli/cobra/root.go +0 -47
- package/src/internal/cli/cobra/spec.go +0 -91
- package/src/internal/cli/console.go +0 -48
- package/src/internal/cli/constitution.go +0 -190
- package/src/internal/cli/constitution_test.go +0 -50
- package/src/internal/cli/implementation.go +0 -153
- package/src/internal/cli/implementation_test.go +0 -165
- package/src/internal/cli/spec.go +0 -369
- package/src/internal/cli/spec_test.go +0 -85
- package/src/internal/constitution/registry.go +0 -139
- package/src/internal/constitution/registry_test.go +0 -97
- package/src/internal/constitution/status.go +0 -70
- package/src/internal/constitution/status_test.go +0 -160
- package/src/internal/core/blueprint.go +0 -49
- package/src/internal/core/blueprint_test.go +0 -58
- package/src/internal/core/config.go +0 -124
- package/src/internal/core/config_test.go +0 -145
- package/src/internal/core/constants.go +0 -13
- package/src/internal/core/errors.go +0 -31
- package/src/internal/core/errors_test.go +0 -48
- package/src/internal/core/hooks.go +0 -89
- package/src/internal/core/hooks_test.go +0 -51
- package/src/internal/core/kit.go +0 -15
- package/src/internal/core/kit_test.go +0 -65
- package/src/internal/core/path.go +0 -115
- package/src/internal/core/path_test.go +0 -101
- package/src/internal/core/ui.go +0 -19
- package/src/internal/installer/dependencies.go +0 -23
- package/src/internal/installer/install.go +0 -89
- package/src/internal/installer/installer.go +0 -45
- package/src/internal/installer/installer_test.go +0 -96
- package/src/internal/project/agents_md.go +0 -108
- package/src/internal/project/agents_md_test.go +0 -101
- package/src/internal/project/bootstrapper.go +0 -64
- package/src/internal/project/bootstrapper_test.go +0 -89
- package/src/internal/project/detector.go +0 -35
- package/src/internal/project/detector_test.go +0 -96
- package/src/internal/project/refresh_integration_test.go +0 -86
- package/src/internal/project/service.go +0 -93
- package/src/internal/project/service_test.go +0 -135
- package/src/internal/spec/archive.go +0 -49
- package/src/internal/spec/archive_test.go +0 -55
- package/src/internal/spec/discovery.go +0 -53
- package/src/internal/spec/discovery_test.go +0 -60
- package/src/internal/spec/implementation.go +0 -296
- package/src/internal/spec/implementation_test.go +0 -253
- package/src/internal/spec/registry.go +0 -142
- package/src/internal/spec/registry_test.go +0 -105
- package/src/internal/spec/scanner.go +0 -219
- package/src/internal/spec/scanner_test.go +0 -243
- package/src/internal/spec/service.go +0 -157
- package/src/internal/spec/service_test.go +0 -238
- package/src/internal/spec/status.go +0 -94
- package/src/internal/spec/status_test.go +0 -146
- package/src/internal/spec/tasks.go +0 -103
- package/src/internal/spec/tasks_test.go +0 -137
- package/src/internal/tui/components.go +0 -132
- package/src/internal/tui/console.go +0 -247
- package/src/internal/tui/console_test.go +0 -19
- package/src/internal/tui/constitution.go +0 -36
- package/src/internal/tui/constitution_test.go +0 -32
- package/src/internal/tui/implementation.go +0 -151
- package/src/internal/tui/logo.go +0 -89
- package/src/internal/tui/multiselect.go +0 -199
- package/src/internal/tui/progressbar.go +0 -37
- package/src/internal/tui/progressbar_test.go +0 -30
- package/src/internal/tui/spec.go +0 -35
- package/src/internal/tui/spinner.go +0 -66
- package/src/internal/tui/terminal.go +0 -18
- package/src/internal/tui/theme.go +0 -125
- package/src/internal/tui/ui.go +0 -52
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
name: spec-clarification-interview
|
|
2
|
-
description: Use when a requirements document has ambiguity or [UNCLEAR] markers and
|
|
3
|
-
needs a one-question-at-a-time clarification interview that updates the source requirement
|
|
4
|
-
incrementally.
|
|
5
|
-
version: 1.0
|
|
6
|
-
priority: HIGH
|
|
7
|
-
content: '# Spec Clarification Interview
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
> **CORE MANDATE:** Resolve ambiguity directly in the requirement text, one decision
|
|
11
|
-
at a time.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## When to use this skill
|
|
15
|
-
|
|
16
|
-
Use for clarification loops, ambiguity removal, underspecified business rules, and
|
|
17
|
-
incremental updates to `requirements.md`.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## How to use it
|
|
21
|
-
|
|
22
|
-
1. Identify the highest-impact ambiguity first.
|
|
23
|
-
|
|
24
|
-
2. Ask exactly one question with a recommended option and bounded alternatives.
|
|
25
|
-
|
|
26
|
-
3. Update the source requirement immediately after the answer.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Checklist
|
|
30
|
-
|
|
31
|
-
- [ ] Only one question is asked at a time.
|
|
32
|
-
|
|
33
|
-
- [ ] The recommended option is explicit and justified.
|
|
34
|
-
|
|
35
|
-
- [ ] The source requirement is updated after each answer.
|
|
36
|
-
|
|
37
|
-
- [ ] Clarification history is logged without replacing source-of-truth text.
|
|
38
|
-
|
|
39
|
-
- [ ] No more than 5 questions are asked in one session.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Interview Rules
|
|
43
|
-
|
|
44
|
-
- Prioritize lifecycle, security, and error-handling gaps first.
|
|
45
|
-
|
|
46
|
-
- Prefer decision-ready options over open-ended prompts.
|
|
47
|
-
|
|
48
|
-
- Replace `[UNCLEAR]` markers with SHALL or MUST language after the answer.
|
|
49
|
-
|
|
50
|
-
- End with a short coverage summary and the next recommended command.
|
|
51
|
-
|
|
52
|
-
'
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
name: task-atomic-decomposition
|
|
2
|
-
description: Use when converting design into executable tasks. Focuses on 5-20 minute
|
|
3
|
-
task slices, explicit dependencies, verification, rollback, and safe parallel tracks.
|
|
4
|
-
version: 1.0
|
|
5
|
-
priority: HIGH
|
|
6
|
-
content: '# Skill: Task Atomic Decomposition & Dependency Mapping
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## When to use this skill
|
|
10
|
-
|
|
11
|
-
Use when turning design into tasks, splitting large work, sequencing dependencies,
|
|
12
|
-
or defining verify and rollback steps.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## How to use it
|
|
16
|
-
|
|
17
|
-
1. Break work into the smallest meaningful units with one clear outcome.
|
|
18
|
-
|
|
19
|
-
2. Define dependency order, verify command, and rollback per task.
|
|
20
|
-
|
|
21
|
-
3. Confirm the roadmap can be executed without hidden assumptions.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Checklist
|
|
25
|
-
|
|
26
|
-
- [ ] Each task is atomic enough to prove complete quickly.
|
|
27
|
-
|
|
28
|
-
- [ ] Dependencies and parallel tracks are explicit.
|
|
29
|
-
|
|
30
|
-
- [ ] Every task has objective verification and safe rollback.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## Artifact Guidance
|
|
34
|
-
|
|
35
|
-
- **For `design.md` consumption**: use the class/file inventory and roadmap as the
|
|
36
|
-
raw material for decomposition.
|
|
37
|
-
|
|
38
|
-
- **For `tasks.md`**: produce 5-20 minute slices with verify, rollback, dependency,
|
|
39
|
-
and `[REQ-X]` context.
|
|
40
|
-
|
|
41
|
-
- **For implementation handoff**: ensure every phase ends in a still-working state.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## References
|
|
45
|
-
|
|
46
|
-
- **Roadmap patterns and decomposition examples**: read [roadmap-patterns.md](references/roadmap-patterns.md)
|
|
47
|
-
when task sizing or rollback quality is unclear.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## 0. Best Practices (Quick Reference)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| # | Principle | Rule | Why |
|
|
54
|
-
|
|
55
|
-
|---|-----------|------|-----|
|
|
56
|
-
|
|
57
|
-
| 1 | **Task Size** | 5-20 min, one clear outcome | Easy verification & rollback
|
|
58
|
-
|
|
|
59
|
-
|
|
60
|
-
| 2 | **Dependencies** | Explicit blockers only | No hidden failures |
|
|
61
|
-
|
|
62
|
-
| 3 | **Parallel** | Different files/agents OK | Avoid merge conflicts |
|
|
63
|
-
|
|
64
|
-
| 4 | **Verify-First** | Define success before coding | Prevents "done but broken"
|
|
65
|
-
|
|
|
66
|
-
|
|
67
|
-
| 5 | **Rollback** | Every task has recovery path | Tasks fail, prepare for it |
|
|
68
|
-
|
|
69
|
-
| 6 | **Context** | Explain WHY not just WHAT | Better agent decisions |
|
|
70
|
-
|
|
71
|
-
| 7 | **Risks** | Identify before they happen | Prepared responses |
|
|
72
|
-
|
|
73
|
-
| 8 | **Milestones** | Each phase ends with working state | Continuous value |
|
|
74
|
-
|
|
75
|
-
| 9 | **Phase X** | Verification is ALWAYS final | Definition of done |
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
## 1. The Micro-Atomic Standard
|
|
79
|
-
|
|
80
|
-
You must break down technical designs into **micro-tasks**. A task is only valid
|
|
81
|
-
if it targets a single logical change that can be verified in isolation.
|
|
82
|
-
|
|
83
|
-
- **Rule of One**: One file, one function, or one configuration entry per task.
|
|
84
|
-
|
|
85
|
-
- **Verify-First**: Every task description must begin with or include the specific
|
|
86
|
-
command or state that confirms success.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
## 2. Dependency & Parallelism Logic
|
|
90
|
-
|
|
91
|
-
- **Explicit Blockers**: Clearly mark tasks that cannot start until another is finished.
|
|
92
|
-
|
|
93
|
-
- **Branching Factor**: Identify tasks that touch different directories or namespaces
|
|
94
|
-
as "Parallel-Ready" to allow multiple agents to work without merge conflicts.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
## 3. The Gravity Rule (Sequencing)
|
|
98
|
-
|
|
99
|
-
Order tasks to build a stable foundation:
|
|
100
|
-
|
|
101
|
-
1. **Infrastructure/Schema**: The "soil" for the code.
|
|
102
|
-
|
|
103
|
-
2. **Contracts/Interfaces**: The "promises" between layers.
|
|
104
|
-
|
|
105
|
-
3. **Core Logic**: The "brain" of the feature.
|
|
106
|
-
|
|
107
|
-
4. **Implementation/UI**: The "skin" and interaction.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
## 4. Resilience & Rollback
|
|
111
|
-
|
|
112
|
-
For every complex task, the plan must imply or state a recovery path (e.g., "Keep
|
|
113
|
-
a backup of the original config" or "Revert migration on failure"). This ensures
|
|
114
|
-
the system never stays in a corrupted state.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
## 5. Contextual Intelligence
|
|
118
|
-
|
|
119
|
-
Never plan a task as a blind instruction. Every task must carry a fragment of the
|
|
120
|
-
"Why" (referencing `[REQ-X]`) so the Executor understands the business value and
|
|
121
|
-
can make micro-decisions correctly.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## 6. Decomposition Quality Checklist
|
|
125
|
-
|
|
126
|
-
Before finalizing, verify the roadmap:
|
|
127
|
-
|
|
128
|
-
- [ ] **Atomicity**: Is every task truly a 5-20 minute effort?
|
|
129
|
-
|
|
130
|
-
- [ ] **Verification**: Does every task have a "Success State" defined?
|
|
131
|
-
|
|
132
|
-
- [ ] **Independence**: Can parallel tasks be executed in any order?
|
|
133
|
-
|
|
134
|
-
- [ ] **Working State**: Does every milestone (end of phase) result in a codebase
|
|
135
|
-
that still passes core tests?
|
|
136
|
-
|
|
137
|
-
'
|
package/src/internal/agent/kit/skills/task-atomic-decomposition/references/roadmap-patterns.yaml
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
content: '# Roadmap Patterns
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Use this reference when a design is hard to decompose cleanly.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Good Atomic Task Shape
|
|
8
|
-
|
|
9
|
-
- One clear outcome.
|
|
10
|
-
|
|
11
|
-
- One obvious verification path.
|
|
12
|
-
|
|
13
|
-
- One safe rollback path.
|
|
14
|
-
|
|
15
|
-
- Minimal file and dependency surface.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## Preferred Sequence
|
|
19
|
-
|
|
20
|
-
1. Infrastructure or schema.
|
|
21
|
-
|
|
22
|
-
2. Contracts and interfaces.
|
|
23
|
-
|
|
24
|
-
3. Core logic.
|
|
25
|
-
|
|
26
|
-
4. Delivery layer or UI.
|
|
27
|
-
|
|
28
|
-
5. Verification and polish.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Scenario Patterns
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### UI-Heavy / Redesign
|
|
35
|
-
|
|
36
|
-
1. Surface shell or layout boundary.
|
|
37
|
-
|
|
38
|
-
2. Route/menu/shell integration when the surface introduces a new access path.
|
|
39
|
-
|
|
40
|
-
3. Surface-specific implementation.
|
|
41
|
-
|
|
42
|
-
4. UI polish.
|
|
43
|
-
|
|
44
|
-
5. A11y / responsive verification.
|
|
45
|
-
|
|
46
|
-
6. Contract verification when backend behavior is consumed.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Backend-Heavy / Domain
|
|
50
|
-
|
|
51
|
-
1. Contract or interface.
|
|
52
|
-
|
|
53
|
-
2. Domain rule or use case.
|
|
54
|
-
|
|
55
|
-
3. Persistence / infrastructure.
|
|
56
|
-
|
|
57
|
-
4. API exposure.
|
|
58
|
-
|
|
59
|
-
5. Verification.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
### Integration-Heavy
|
|
63
|
-
|
|
64
|
-
1. External contract assumptions.
|
|
65
|
-
|
|
66
|
-
2. Adapter or gateway.
|
|
67
|
-
|
|
68
|
-
3. Failure handling / fallback.
|
|
69
|
-
|
|
70
|
-
4. Observability.
|
|
71
|
-
|
|
72
|
-
5. Verification.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
### Migration / Rollout
|
|
76
|
-
|
|
77
|
-
1. Prepare compatibility.
|
|
78
|
-
|
|
79
|
-
2. Rollout-compatible implementation.
|
|
80
|
-
|
|
81
|
-
3. Verification.
|
|
82
|
-
|
|
83
|
-
4. Cleanup / deprecation removal.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
## Parallelism Rule
|
|
87
|
-
|
|
88
|
-
- Parallelize tasks that touch different files or modules and do not share a hidden
|
|
89
|
-
blocker.
|
|
90
|
-
|
|
91
|
-
- Do not parallelize tasks whose verify steps depend on unfinished upstream contract
|
|
92
|
-
work.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## Rollback Examples
|
|
96
|
-
|
|
97
|
-
- Restore one config file from the previous content.
|
|
98
|
-
|
|
99
|
-
- Revert one migration file or disable one flag.
|
|
100
|
-
|
|
101
|
-
- Remove one newly introduced route, job, or component.
|
|
102
|
-
|
|
103
|
-
'
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
package agent
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"testing"
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
func TestKitManifests(t *testing.T) {
|
|
8
|
-
kitFS, err := GetKitFS()
|
|
9
|
-
if err != nil {
|
|
10
|
-
t.Fatalf("failed to get kit FS: %v", err)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
registry := &Registry{}
|
|
14
|
-
err = registry.Initialize(kitFS)
|
|
15
|
-
if err != nil {
|
|
16
|
-
t.Fatalf("failed to initialize registry with kit FS: %v", err)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Check open-code
|
|
20
|
-
opencode, ok := registry.GetAgent("open-code")
|
|
21
|
-
if !ok {
|
|
22
|
-
t.Error("expected to find 'open-code' agent in kit")
|
|
23
|
-
} else {
|
|
24
|
-
if opencode.DirName != ".opencode/" {
|
|
25
|
-
t.Errorf("expected open-code DirName '.opencode/', got '%s'", opencode.DirName)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Check kilo-code
|
|
30
|
-
kilocode, ok := registry.GetAgent("kilo-code")
|
|
31
|
-
if !ok {
|
|
32
|
-
t.Error("expected to find 'kilo-code' agent in kit")
|
|
33
|
-
} else {
|
|
34
|
-
if kilocode.DirName != ".kilocode/" {
|
|
35
|
-
t.Errorf("expected kilo-code DirName '.kilocode/', got '%s'", kilocode.DirName)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Check antigravity (to be sure)
|
|
40
|
-
antigravity, ok := registry.GetAgent("antigravity")
|
|
41
|
-
if !ok {
|
|
42
|
-
t.Error("expected to find 'antigravity' agent in kit")
|
|
43
|
-
} else {
|
|
44
|
-
if antigravity.DirName != ".agent/" {
|
|
45
|
-
t.Errorf("expected antigravity DirName '.agent/', got '%s'", antigravity.DirName)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Check kimi-code
|
|
50
|
-
kimicode, ok := registry.GetAgent("kimi-code")
|
|
51
|
-
if !ok {
|
|
52
|
-
t.Error("expected to find 'kimi-code' agent in kit")
|
|
53
|
-
} else {
|
|
54
|
-
if kimicode.DirName != ".kimi/" {
|
|
55
|
-
t.Errorf("expected kimi-code DirName '.kimi/', got '%s'", kimicode.DirName)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
package agent
|
|
2
|
-
|
|
3
|
-
// AgentMetadata contains the descriptive metadata for an agent.
|
|
4
|
-
type AgentMetadata struct {
|
|
5
|
-
ID string `yaml:"id"`
|
|
6
|
-
Name string `yaml:"name"`
|
|
7
|
-
Description string `yaml:"description"`
|
|
8
|
-
DirName string `yaml:"dir_name"`
|
|
9
|
-
Version string `yaml:"version"`
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// AgentManifest is the structure of the manifest.yaml file found in each agent directory.
|
|
13
|
-
type AgentManifest struct {
|
|
14
|
-
AgentMetadata `yaml:",inline"`
|
|
15
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
package agent
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
"io/fs"
|
|
6
|
-
"sort"
|
|
7
|
-
|
|
8
|
-
"github.com/jeancodogno/specforce-kit/src/internal/core"
|
|
9
|
-
"gopkg.in/yaml.v3"
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
// Registry stores and manages discovered agent metadata.
|
|
13
|
-
type Registry struct {
|
|
14
|
-
agents map[string]AgentMetadata
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Initialize parses kit.yaml from the provided filesystem to populate agent metadata.
|
|
18
|
-
func (r *Registry) Initialize(kitFS fs.FS) error {
|
|
19
|
-
r.agents = make(map[string]AgentMetadata)
|
|
20
|
-
|
|
21
|
-
data, err := fs.ReadFile(kitFS, "kit.yaml")
|
|
22
|
-
if err != nil {
|
|
23
|
-
return fmt.Errorf("failed to read kit.yaml: %w", err)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var config core.KitConfig
|
|
27
|
-
if err := yaml.Unmarshal(data, &config); err != nil {
|
|
28
|
-
return fmt.Errorf("failed to parse kit.yaml: %w", err)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
for id, route := range config.Tools {
|
|
32
|
-
name := route.Name
|
|
33
|
-
if name == "" {
|
|
34
|
-
name = id
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
metadata := AgentMetadata{
|
|
38
|
-
ID: id,
|
|
39
|
-
Name: name,
|
|
40
|
-
Description: route.Description,
|
|
41
|
-
DirName: route.Target,
|
|
42
|
-
Version: "1.0.0", // default since we removed version
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
r.agents[id] = metadata
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return nil
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// GetAgents returns a list of all discovered agent metadata, sorted by ID.
|
|
52
|
-
func (r *Registry) GetAgents() []AgentMetadata {
|
|
53
|
-
agents := make([]AgentMetadata, 0, len(r.agents))
|
|
54
|
-
for _, a := range r.agents {
|
|
55
|
-
agents = append(agents, a)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
sort.Slice(agents, func(i, j int) bool {
|
|
59
|
-
return agents[i].ID < agents[j].ID
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
return agents
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// GetAgent returns a specific agent's metadata by ID.
|
|
66
|
-
func (r *Registry) GetAgent(id string) (AgentMetadata, bool) {
|
|
67
|
-
a, ok := r.agents[id]
|
|
68
|
-
return a, ok
|
|
69
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
package agent
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"testing"
|
|
5
|
-
"testing/fstest"
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
func TestRegistry_Initialize(t *testing.T) {
|
|
9
|
-
mockFS := fstest.MapFS{
|
|
10
|
-
"kit.yaml": {
|
|
11
|
-
Data: []byte(`
|
|
12
|
-
tools:
|
|
13
|
-
claude:
|
|
14
|
-
name: "Claude"
|
|
15
|
-
description: "Claude agent"
|
|
16
|
-
target: ".claude"
|
|
17
|
-
gemini:
|
|
18
|
-
name: "Gemini"
|
|
19
|
-
description: "Gemini agent"
|
|
20
|
-
target: ".gemini"
|
|
21
|
-
`),
|
|
22
|
-
},
|
|
23
|
-
"some-other-file.txt": {
|
|
24
|
-
Data: []byte("ignored"),
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
registry := &Registry{}
|
|
29
|
-
err := registry.Initialize(mockFS)
|
|
30
|
-
if err != nil {
|
|
31
|
-
t.Fatalf("failed to initialize registry: %v", err)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
agents := registry.GetAgents()
|
|
35
|
-
if len(agents) != 2 {
|
|
36
|
-
t.Errorf("expected 2 agents, got %d", len(agents))
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
claude, ok := registry.GetAgent("claude")
|
|
40
|
-
if !ok {
|
|
41
|
-
t.Error("expected to find 'claude' agent")
|
|
42
|
-
}
|
|
43
|
-
if claude.Name != "Claude" {
|
|
44
|
-
t.Errorf("expected Name 'Claude', got '%s'", claude.Name)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
_, ok = registry.GetAgent("non-existent")
|
|
48
|
-
if ok {
|
|
49
|
-
t.Error("did not expect to find 'non-existent' agent")
|
|
50
|
-
}
|
|
51
|
-
}
|