## Summary - implement the canonical operation type source-of-truth slice across operation writers, monitoring surfaces, onboarding flows, and supporting services - add focused contract and regression coverage for canonical operation type handling - include the generated spec 239 artifacts for the feature slice ## Validation - browser smoke PASS for `/admin` -> workspace overview -> operations -> operation detail -> tenant-scoped operations drilldown - spec/plan/tasks/quickstart artifact analysis cleaned up to a no-findings state - automated test suite not run in this session Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #276
14 KiB
Skill: Spec Kit Next-Best One-Shot Preparation
Purpose
Use this skill when the user wants the agent to select the most suitable next spec from existing product planning sources and then execute the real GitHub Spec Kit preparation flow in one pass:
- select the next best spec candidate from roadmap and spec candidates
- run the repository's Spec Kit
specifyflow for that selected candidate - run the repository's Spec Kit
planflow for the generated spec - run the repository's Spec Kit
tasksflow for the generated plan - run the repository's Spec Kit
analyzeflow against the generated artifacts - fix issues in Spec Kit preparation artifacts only (
spec.md,plan.md,tasks.md, and related Spec Kit metadata if required) - stop before implementation
- provide a concise readiness summary for the user
This skill must use the repository's actual Spec Kit scripts, commands, templates, branch naming rules, and generated paths. It must not manually bypass Spec Kit by creating arbitrary spec folders or files. The only allowed fixes after analyze are preparation-artifact fixes, not application-code implementation.
The intended workflow is:
roadmap.md + spec-candidates.md
→ select next best spec
→ run Spec Kit specify
→ run Spec Kit plan
→ run Spec Kit tasks
→ run Spec Kit analyze
→ fix preparation-artifact issues
→ explicit implementation step later
When to Use
Use this skill when the user asks things like:
Nimm die nächste sinnvollste Spec aus roadmap und spec-candidates und führe specify, plan, tasks und analyze aus.
Wähle die nächste geeignete Spec und mach den Spec-Kit-Flow inklusive analyze in einem Rutsch.
Schau in roadmap.md und spec-candidates.md und starte daraus specify, plan, tasks und analyze.
Such die beste nächste Spec aus und bereite sie per GitHub Spec Kit vollständig vor.
Nimm angesichts Roadmap und Spec Candidates das sinnvollste nächste Thema, aber nicht implementieren.
Hard Rules
- Work strictly repo-based.
- Use the repository's actual GitHub Spec Kit workflow.
- Do not manually invent spec numbers, branch names, or spec paths if Spec Kit provides a script or command for that.
- Do not manually create
spec.md,plan.md, ortasks.mdwhen the Spec Kit workflow can generate them. - Do not bypass Spec Kit branch mechanics.
- Run
analyzeaftertaskswhen the repository supports it. - Fix only issues found in Spec Kit preparation artifacts and planning metadata.
- Do not treat analyze findings as permission to implement product code.
- If analyze reports implementation work as missing, record it in
tasks.mdinstead of implementing it. - Do not implement application code.
- Do not modify production code.
- Do not modify migrations, models, services, jobs, Filament resources, Livewire components, policies, commands, or tests unless the user explicitly starts a later implementation task.
- Do not execute implementation commands.
- Do not run destructive commands.
- Do not invent roadmap priorities not supported by repository documents.
- Do not pick a spec only because it is listed first.
- Do not select broad platform rewrites when a smaller dependency-unlocking spec is more appropriate.
- Prefer specs that unlock roadmap progress, reduce architectural drift, harden foundations, or remove known blockers.
- Prefer small, reviewable, implementation-ready specs over large ambiguous themes.
- Preserve TenantPilot/TenantAtlas terminology.
- Follow the repository constitution and existing Spec Kit conventions.
- If repository truth conflicts with roadmap/candidate wording, keep repository truth and document the deviation.
- If no candidate is suitable, do not run Spec Kit commands and explain why.
Required Repository Checks Before Selection
Before selecting the next spec, inspect:
.specify/memory/constitution.md.specify/templates/.specify/scripts/- existing Spec Kit command usage or repository instructions, if present
specs/docs/product/spec-candidates.md- roadmap documents under
docs/product/, especiallyroadmap.mdif present - nearby existing specs related to top candidate areas
- current branch and git status
- application code only as needed to verify whether a candidate is already done, blocked, duplicated, or technically mis-scoped
Do not edit application code.
Git and Branch Safety
Before running any Spec Kit command or script:
- Check the current branch.
- Check whether the working tree is clean.
- If there are unrelated uncommitted changes, stop and report them. Do not continue.
- If the working tree only contains user-intended planning edits for this operation, continue cautiously.
- Let Spec Kit create or switch to the correct feature branch when that is how the repository workflow works.
- Do not force checkout, reset, stash, rebase, merge, or delete branches.
- Do not overwrite existing specs.
If the repo requires an explicit branch creation script for specify, use that script rather than manually creating the branch.
Candidate Selection Criteria
Evaluate candidate specs using these criteria.
1. Roadmap Fit
Prefer candidates that directly support the current roadmap sequence or unlock the next roadmap layer.
Examples:
- governance foundations before advanced compliance views
- evidence/snapshot foundations before auditor packs
- control catalog foundations before CIS/NIS2 mappings
- decision/workflow surfaces before autonomous governance
- provider/platform boundary cleanup before multi-provider expansion
2. Foundation Value
Prefer candidates that strengthen reusable platform foundations:
- RBAC and workspace/tenant isolation
- auditability
- evidence and snapshot truth
- operation observability
- provider boundary neutrality
- canonical vocabulary
- baseline/control/finding semantics
- enterprise detail-page or decision-surface patterns
3. Dependency Unblocking
Prefer specs that unblock multiple later candidates.
A good next spec should usually make future specs smaller, safer, or more consistent.
4. Scope Size
Prefer a candidate that can be implemented as a narrow, testable slice.
Avoid selecting:
- broad platform rewrites
- vague product themes
- multi-feature bundles
- speculative future-provider frameworks
- large UX redesigns without a clear first slice
5. Repo Readiness
Prefer candidates where the repository already has enough structure to implement the next slice safely.
Check whether related models, services, UI pages, tests, or concepts already exist.
6. Risk Reduction
Prefer candidates that reduce current architectural or product risk:
- legacy dual-world semantics
- unclear truth ownership
- inconsistent operator UX
- missing audit/evidence boundaries
- repeated manual workflow friction
- false-positive calmness in governance surfaces
7. User/Product Value
Prefer specs that produce visible operator value or make the platform more sellable without creating heavy scope.
Required Selection Output Before Spec Kit Execution
Before running the Spec Kit flow, identify:
- selected candidate title
- source location in roadmap/spec-candidates
- why it was selected
- why close alternatives were deferred
- roadmap relationship
- smallest viable implementation slice
- proposed concise feature description to feed into
specify
The feature description must be product- and behavior-oriented. It should not be a low-level implementation plan.
Spec Kit Execution Flow
After selecting the candidate, execute the real repository Spec Kit preparation sequence, including analysis and preparation-artifact fixes.
Step 1: Determine the repository's Spec Kit command pattern
Inspect repository instructions and scripts to identify how this repo expects Spec Kit to be run.
Common locations to inspect:
.specify/scripts/
.specify/templates/
.specify/memory/constitution.md
.github/prompts/
.github/skills/
README.md
specs/
Use the repo-specific mechanism if present.
Step 2: Run specify
Run the repository's specify flow using the selected candidate and the smallest viable slice.
The specify input should include:
- selected candidate title
- problem statement
- operator/user value
- roadmap relationship
- out-of-scope boundaries
- key acceptance criteria
- important enterprise constraints
Let Spec Kit create the correct branch and spec location if that is the repo's configured behavior.
Step 3: Run plan
Run the repository's plan flow for the generated spec.
The plan input should keep the scope tight and should require repo-based alignment with:
- constitution
- existing architecture
- workspace/tenant isolation
- RBAC
- OperationRun/observability where relevant
- evidence/snapshot/truth semantics where relevant
- Filament/Livewire conventions where relevant
- test strategy
Step 4: Run tasks
Run the repository's tasks flow for the generated plan.
The generated tasks must be:
- ordered
- small
- testable
- grouped by phase
- limited to the selected scope
- suitable for later manual analysis before implementation
Step 5: Run analyze
Run the repository's analyze flow against the generated Spec Kit artifacts.
Analyze must check:
- consistency between
spec.md,plan.md, andtasks.md - constitution alignment
- roadmap alignment
- whether the selected candidate was narrowed safely
- whether tasks are complete enough for implementation
- whether tasks accidentally require scope not described in the spec
- whether plan details conflict with repository architecture or terminology
- whether implementation risks are documented instead of silently ignored
Do not use analyze as a trigger to implement application code.
Step 6: Fix preparation-artifact issues only
If analyze finds issues, fix only Spec Kit preparation artifacts such as:
spec.mdplan.mdtasks.md- generated Spec Kit metadata files, if the repository uses them
Allowed fixes include:
- clarify requirements
- tighten scope
- move out-of-scope work into follow-up candidates
- correct terminology
- add missing tasks
- remove tasks not backed by the spec
- align plan language with repository architecture
- add missing acceptance criteria or validation tasks
Forbidden fixes include:
- modifying application code
- creating migrations
- editing models, services, jobs, policies, Filament resources, Livewire components, tests, or commands
- running implementation or test-fix loops
- changing runtime behavior
Step 7: Stop
After analyze has passed or preparation-artifact issues have been fixed, stop.
Do not implement. Do not modify application code. Do not run implementation tests unless the repository's Spec Kit preparation command requires a non-destructive validation.
Failure Handling
If a Spec Kit command or analyze phase fails:
- Stop immediately.
- Report the failing command or phase.
- Summarize the error.
- Do not attempt implementation as a workaround.
- Suggest the smallest safe next action.
If the branch or working tree state is unsafe:
- Stop before running Spec Kit commands.
- Report the current branch and relevant uncommitted files.
- Ask the user to commit, stash, or move to a clean worktree.
Final Response Requirements
After the Spec Kit preparation flow completes, respond with:
- Selected candidate
- Why this candidate was selected
- Why close alternatives were deferred
- Current branch after Spec Kit execution
- Generated spec path
- Files created or updated by Spec Kit
- Analyze result summary
- Preparation-artifact fixes applied after analyze
- Assumptions made
- Open questions, if any
- Recommended next implementation prompt
- Explicit statement that no application implementation was performed
Keep the response concise, but include enough detail for the user to continue immediately.
Required Next Implementation Prompt
Always provide a ready-to-copy implementation prompt like this, adapted to the generated spec branch/path, but only after analyze has passed or preparation-artifact issues have been fixed:
Du bist ein Senior Staff Software Engineer für TenantPilot/TenantAtlas.
Implementiere die vorbereitete Spec `<spec-branch-or-spec-path>` streng anhand von `tasks.md`.
Wichtig:
- Arbeite task-sequenziell.
- Ändere nur Dateien, die für die jeweilige Task notwendig sind.
- Halte dich an `spec.md`, `plan.md`, `tasks.md` und die Constitution.
- Keine Scope-Erweiterung.
- Keine Opportunistic Refactors.
- Führe passende Tests nach sinnvollen Task-Gruppen aus.
- Wenn eine Task unklar oder falsch ist, stoppe und dokumentiere den Konflikt statt frei zu improvisieren.
- Am Ende liefere geänderte Dateien, Teststatus, offene Risiken und nicht erledigte Tasks.
Example Invocation
User:
Nutze den Skill spec-kit-next-best-one-shot.
Wähle aus roadmap.md und spec-candidates.md die nächste sinnvollste Spec.
Führe danach GitHub Spec Kit specify, plan, tasks und analyze in einem Rutsch aus.
Behebe alle analyze-Issues in den Spec-Kit-Artefakten.
Keine Application-Implementierung.
Expected behavior:
- Inspect constitution, Spec Kit scripts/templates, specs, roadmap, and spec candidates.
- Check branch and working tree safety.
- Compare candidate suitability.
- Select the next best candidate.
- Run the repository's real Spec Kit
specifyflow, letting it handle branch/spec setup. - Run the repository's real Spec Kit
planflow. - Run the repository's real Spec Kit
tasksflow. - Run the repository's real Spec Kit
analyzeflow. - Fix analyze issues only in Spec Kit preparation artifacts.
- Stop before application implementation.
- Return selection rationale, branch/path summary, artifact summary, analyze summary, fixes applied, and next implementation prompt.