Spec Kit Integration Details
Breakdown of files, prompts, scripts, and templates added when integrating Spec Kit into NexisChat.
This document explains the integration introduced in commit c906ed7 ("feat: integrated spec-kit into repo"), covering added assets, their roles, and how to extend them.
Summary of Added Paths
| Path | Type | Purpose |
|---|---|---|
.github/prompts/specify.prompt.md | Prompt | System-style instruction guiding generation of specifications from /specify command |
.github/prompts/plan.prompt.md | Prompt | Guides /plan output structure (architecture, constraints, sequencing) |
.github/prompts/tasks.prompt.md | Prompt | Shapes /tasks output (granular, testable units) |
memory/constitution.md | Knowledge Base | Canon of non‑negotiable engineering/product principles consumed by prompts |
memory/constitution_update_checklist.md | Checklist | Process aid for updating constitution safely & consistently |
packages/scripts/src/spec-kit/create-new-feature.sh | Script | Scaffolds feature artifact directories/templates (spec/plan/tasks) |
packages/scripts/src/spec-kit/get-feature-paths.sh | Script | Resolves normalized feature paths (used by other scripts) |
packages/scripts/src/spec-kit/setup-plan.sh | Script | Prepares contextual inputs for plan generation (e.g., enumerating existing modules) |
packages/scripts/src/spec-kit/update-agent-context.sh | Script | Refreshes or aggregates context memory for agents (could be extended for summaries) |
packages/scripts/src/spec-kit/check-task-prerequisites.sh | Script | Validates environment/tooling before implementing a task |
packages/scripts/src/spec-kit/common.sh | Script | Shared logging + utility functions used across automation scripts |
templates/spec-template.md | Template | Skeleton shape for specification artifact |
templates/plan-template.md | Template | Standard sections for technical implementation plans |
templates/tasks-template.md | Template | Structure for task breakdown (IDs, acceptance criteria) |
templates/agent-file-template.md | Template | Generic agent context or artifact scaffold |
Prompt Files
Prompts are colocated under .github/prompts/ so GitHub Copilot Chat can easily ingest them when referencing the repository context. Each prompt file encodes:
- Role framing: e.g., treat the model as a rigorous architect vs. product analyst.
- Output contract: required sections, formatting expectations.
- Guardrails: avoid implementation details too early, ensure explicit assumptions list.
Customization Guidelines
| Customization | When | How |
|---|---|---|
| Add organization constraints | New compliance/security rule | Append to relevant prompt under a clearly labeled section |
| Adjust section ordering | Review friction or low adoption | Reorder headings & reflect in corresponding template |
| Strengthen rejection criteria | Model drifts into code early | Add explicit “Reject any attempt to...” language |
Keep prompts concise enough to avoid token bloat while retaining determinism.
Constitution
memory/constitution.md encodes durable principles (security posture, architectural preferences, coding conventions). The goal: centralize guidance so AI outputs reflect institutional standards without re-stating them per prompt.
Use memory/constitution_update_checklist.md before editing to:
- Verify change justification
- Communicate impact (e.g., requires regenerating plans?)
- Version or annotate amendments (consider adding a Changelog section)
Good Constitution Entries
- Stable & strategic (e.g., "All external HTTP calls must pass through a typed gateway layer")
- Non-transient (avoid sprint-specific items)
- Testable or reviewable (code reviewers can enforce)
Templates
Templates ensure generated artifacts are uniform, increasing readability & diffability. They reduce accidental omission of critical sections.
| Template | Key Sections |
|---|---|
| Spec | Problem, Users, Outcomes, Scope (In/Out), User Journeys, Edge Cases, Assumptions, Open Questions |
| Plan | Architecture Overview, Data Model, APIs, Module Boundaries, State & Caching, Observability, Security, Risks, Alternatives, Open Questions |
| Tasks | Task Table / Checklist, Acceptance Criteria, Validation Strategy, Dependencies, Out-of-scope confirmations |
Scripts Overview
Scripts accelerate consistent usage across contributors and can be integrated into CI or local automations.
create-new-feature.sh
Likely flow (extend as needed):
- Accept feature slug / human-readable name.
- Create directories:
specs/,plans/,tasks/if missing. - Copy templates with substituted placeholders (title/date/slug).
- Optionally open spec in editor.
setup-plan.sh
Purpose: Gather context before invoking /plan, e.g.:
- Enumerate relevant existing services/modules
- Collect data schema references
- Output a summary file the agent can read
update-agent-context.sh
Future enhancement candidate: produce embeddings or summarizations (e.g., component maps) to reduce hallucination.
check-task-prerequisites.sh
Prevents starting implementation when prerequisites (migrations, environment variables, running services) are missing.
Suggested Directory Conventions (Adopt Incrementally)
/specs
feature-workspace-sharing.md
/plans
feature-workspace-sharing-plan.md
/tasks
feature-workspace-sharing-tasks.mdAdd an index file per directory if browsing grows.
Integration Validation Checklist
| Concern | Status | Notes |
|---|---|---|
| Prompts present | ✅ | All three phase prompts added |
| Constitution established | ✅ | Needs periodic review cadence |
| Templates available | ✅ | Align with prompt output contracts |
| Scripts executable | ⚠️ | Ensure executable bit (chmod +x packages/scripts/src/spec-kit/*.sh) |
| Docs added | ✅ | Overview + Workflow + Integration (this) |
| Onboarding path | ⚠️ | Add quickstart snippet to root README (future) |
Next Hardening Steps
- Add CI lint to enforce presence of required sections in new spec/plan/task PRs.
- Introduce artifact changelog sections to track evolution.
- Add script to diff two plan versions (for alternative exploration).
- Incorporate minimal test generation hints per task.
- Provide a
make feature slug=<...>wrapper for ergonomics.
Decision Log (Start Here)
| Date | Decision | Rationale | Impact |
|---|---|---|---|
| 2025-09-08 | Adopt Spec Kit | Improve AI-assisted change quality & repeatability | Adds upfront artifact cost, lowers rework |
(Extend this table as process evolves.)
Proceed to Customization & Best Practices for extending this toolkit.