Skip to content
ThaiG2ProPublic

About

sdlc kit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SDLC Kit — Multi-Target Agentic Engineering Kit

A project-agnostic, multi-target SDLC kit for Google Antigravity (agy), Claude Code, and Kiro (IDE + CLI) backed by the SDLC Context Engine (persistent Model Context Protocol server + fast CLI). Drop a full S1→S6 pipeline (orchestrator + 4 role agents + 3 utility agents + 24 skills + steering rules + security hooks) into any project with one command, then fill a small context contract so the agents understand your project.

📖 Installing & using the kit? → GUIDE.md (the User Guide / HDSD: install, onboard, run a work item, pass gates, update). This README is the architecture overview — what the kit is and how it's built.

🚀 Quickstart

1. Install into Your Existing Project (Recommended)

Drop the entire SDLC pipeline and Context Engine into any repository in seconds with Zero external pip dependencies (100% Python standard library):

cd /path/to/my-project

# Option A: Via npx (from npm package)
npx kiro-sdlc-init --target agy

# Option B: From local clone
node /path/to/sdlc-kit/bin/init.mjs . --target agy

This single command automatically:

  • Scaffolds .agents/ (Antigravity), rules, 24 skills, and subagents (analyst, architect, developer, qa).
  • Copies executables into bin/sdlc-ctx, bin/sdlc-mcp, bin/sdlc-setup, bin/sdlc-demo.
  • Initializes the SQLite Context Engine at .sdlc/session.db (34 tables & FTS5 full-text search).
  • Configures your IDE MCP integration (~/.gemini/config/mcp_config.json, Claude, or Cursor).
  • Creates root GEMINI.md for instant auto-discovery by Antigravity.

2. Try the Demo Directly in this Repo

Want to inspect or test the kit first? Run the interactive 3-second demo:

git clone git@github.com:ThaiG2Pro/sdlc-kit.git
cd sdlc-kit

# Run automated setup (verifies environment, inits DB, auto-configures MCP)
./bin/sdlc-setup

# Run the live interactive lifecycle demo (S1 → S6 in 3 seconds)
./bin/sdlc-demo

🎯 Multi-Platform Architecture

One source emits all three targets — kit/shared/** overlaid by kit/targets/<platform>/**. You pick the platform at install time (--target agy|claude|kiro|all); the framework (process, skills, gates, security model) is identical on all.

Google Antigravity (agy) Claude Code Kiro (IDE + CLI)
Emits .agents/ + root GEMINI.md .claude/ .kiro/
Launch Orchestrator Top-level agy session with GEMINI.md claude --agent sdlc-full <slug> sdlc-full agent (ctrl+0)
Delegate Phase invoke_subagent (Analyst/Architect/Dev/QA) spawn role subagent (Task tool) /agent swap (IDE) or CLI
Code-Write Guard hooks.json PreToolUse hook agent_type in PreToolUse hook agent name via argv[1]
Context Engine Native MCP Tools (sdlc_*) or Fast CLI Native MCP Tools or Fast CLI Native MCP Tools or Fast CLI

⚡ High-Performance SDLC Context Engine

Instead of having AI agents repeatedly read and write dozens of kilobytes of markdown baton files (_handoff.md, _state.json), the SDLC Kit is powered by a high-performance SQLite Context Engine with sub-millisecond query execution:

  • Persistent MCP Server (bin/sdlc-mcp): Communicates over JSON-RPC stdio. Zero fork overhead, keeps SQLite connection hot in memory with WAL mode. Average latency: 1.55ms (100x faster than process-spawning CLIs).
  • Fast CLI (bin/sdlc-ctx): Optimized CLI with lazy imports, fast-path argument parsing, and atomic batch commands.
  • 7 Chunky Tools:
    1. sdlc_manage_lifecycle: Change init, transitions (S1→S6), gate inspection and approvals.
    2. sdlc_record_spec_bundle: Atomic batch insertion of AC requirements, edge cases, STRIDE threats, and spec lock.
    3. sdlc_get_work_context: Consolidated 1-call query delivering active task, mapped ACs, and reading order.
    4. sdlc_submit_task_result: Complete tasks with mandatory test proof and commit logging.
    5. sdlc_audit_and_verify: QA audit context inspection, batch test scenario recording, bug logging.
    6. sdlc_flex_patch: In-flight amendments (patch schema, insert urgent task, supersede ADR).
    7. sdlc_inspect_query: Swiss Army Knife for FTS5 full-text search, table inspection, and safe read-only SQL.

On both, the orchestrator is a dedicated agent (sdlc-full/sdlc-fast) that drives the pipeline, delegates each phase to its role agent, and owns the gates — it never writes code (only the developer agent does) and is write-fenced to baton/state files. A plain session (no role agent) is your unrestricted default workspace — the kit's preToolUse guards bind only the role agents, so normal interactive work is never blocked.

Two layers

FRAMEWORK — per-platform, re-emitted by init        SHARED — one root copy (no symlink), referenced root-relative
  <platform>/agents/   role + orchestrator agents       ./context/    project·stack·conventions·
  <platform>/commands/ slash commands (Claude)                        architecture·glossary·legacy-ref.md
  <platform>/skills/   24 skills                         ./openspec/   spec-driven workspace
  <platform>/steering/ rules (per-file `inclusion:`)    ./memory/     per-role memory
  <platform>/ai/  <platform>/tools/  rules + guards      ./docs/       intake packages + project docs
  .kiro/context-map.json   (Kiro wiring only)            ./sdlc.config.json · ./pipelines.json
                                                         (both platforms read these at the root, no symlink)

<platform> is .kiro/ or .claude/. The orchestrator is the sdlc-full/sdlc-fast agent (Kiro: ctrl+0/ctrl+5; Claude: claude --agent sdlc-full). The /sdlc-full · /sdlc-fast slash commands are thin launchers; the per-role commands (/analyst … /onboarder) spawn one guarded role agent — see GUIDE.md § Agents & shortcuts.

Separation of concerns: the shared workspace + project config live once at the root; the framework runtime (agents, commands, skills, steering, ai, tools, settings/hooks) stays per-platform. Edit the root copy of context/ / sdlc.config.json / pipelines.json → both targets see it (no drift; a kiro↔claude switch never loses config). Each project owns its copy after init — no submodule coupling, no framework/project file mixing.

Security model — who can write what

A role is a playbook, not an identity. Loading a role's prompt ("I'm the architect now") borrows its checklist; it does not grant its write-permissions. What a session may write is decided by its host-provided identity, never by what it claims:

  • Kiro — the active agent's name is its own hook's argv[1] (per-agent preToolUse). Claiming a role doesn't change it.
  • Claude — a role agent (claude --agent <role> or Task-spawned) carries agent_type; a plain session has none.

Each identity gets a fixed write-fence (Kiro: <agent>.json → toolsSettings.write.allowedPaths; Claude: check-write-path.py's built-in policy, host-selected):

Identity May write Code?
plain session (no role agent — your default workspace) anything your own session
orchestrator (sdlc-full/sdlc-fast agent) baton/state only — openspec/changes/**/_*, openspec/_*.md, memory/** ❌
analyst openspec/**, memory/** ❌
architect openspec/**, memory/** ❌
qa openspec/**, memory/**, test/** … __tests__/** ❌ tests only
intake docs/extra-docs/** + baton/state only ❌ input docs only
context-refresh context/**, openspec/** ❌
onboarder context/**, openspec/** ❌
developer src/** app/** lib/** … package.json … + the above ✅ only this one

Two consequences:

  • The orchestrator can't even produce a phase deliverable — proposal.md/design.md/tasks.md/ specs/**/*-report.md are not baton _-files, so if it tries to write one the guard blocks it (exit 2), forcing it to delegate to the role agent. So "the orchestrator does S3 itself" cannot happen — the guard, not goodwill, prevents it.
  • Only the developer identity has code paths; impersonation can't escalate, because the guard keys on the host-provided identity, not the prose. A project whose code lives off the standard roots extends the fence via sdlc.config.json.paths.{code_roots,test_roots} (preserved across --force).

Three enforcement layers (defense in depth):

  1. Subagent tools frontmatter — every role declares its tool set (no Task on role agents; all write-capable tools Write/Edit route to layer 3). Edit is granted to every role: it reaches no path that Write can't already overwrite, and a one-line Edit is far safer than rewriting a whole file.
  2. permissions.deny (Claude settings.json) — coarse blanket bans (e.g. editing the kit's own agents/commands/settings). Not role-aware by design.
  3. PreToolUse guards (check-write-path.py / check-shell-command.py) — role-aware, fail-closed, host-selected policy; the only layer that grants developer its code exception. The backstop, because an LLM's self-description ("I am the developer now") isn't trustworthy.

The orchestrator is a dedicated agent, not your main session — so a plain session is unrestricted (the guards bind only the named role agents; normal work is never blocked). Code and every deliverable are produced by the role agent: on Claude the orchestrator spawns it (Task); on Kiro CLI it delegates ("use the {role} agent"); /agent swap is the manual fallback.

Context preservation protocol (CPP) & gate guards

Every phase hands the next a baton of underscore-prefixed context files in the change dir — _handoff.md, _decisions.jsonl, _glossary.md, _progress.md, _state.json — plus the cross-spec bridge, one file per change: openspec/_cross-spec-context/<change-name>.md (never a single shared file every branch would conflict on). This is deterministically enforced, not just prose:

  • pipeline-guard.mjs (the orchestrator calls it before every approve) blocks out-of-order gates, fence-jumps, and missing-artifact approvals; its STEP 0 rejects a drifted _state.json.
  • cpp-guard.mjs fails a gate when the outgoing phase's baton is incomplete — and now also when a role hasn't recorded its role-memory write-back decision (_state.json.memory_writeback.<role> ∈ {appended, nothing-reusable}), closing the gap where a one-shot agent returned and silently lost its only chance to persist a cross-spec lesson.
  • state-schema.mjs validates the canonical _state.json shape at write time (via state-set.mjs) and at guard STEP 0, so drift surfaces immediately instead of one gate later. It also holds the key allowlist: state-set refuses a write that introduces a key nothing reads (pre-existing drift only warns, so a change mid-flight never deadlocks).

The baton is bounded, because every role re-reads all five files on every spawn — left to accumulate it costs more than the agent prompt itself. Ceilings: _state.json ≤8 KB (canonical keys only), _handoff.md ≤6 KB and replaced each phase rather than appended, _glossary.md ≤6 KB with one-line definitions edited in place (no [SUPERSEDED] twins), _progress.md ≤4 KB, whole baton ≤24 KB; _decisions.jsonl entries are the one-line WHAT (decision ≤240 chars) with the analysis in the phase report, which is read once at its gate. cpp-guard reports anything over cap at every gate, and baton-compact.mjs (run by the orchestrator after each approve) archives what nothing reads into <CHANGE_DIR>/_archive/. The split that decides where content goes: baton = written once, read on every later spawn; phase artifact = written once, read once at its gate.

Trailing side-effects the orchestrator owes (cross-spec bridge at S3, progress marking, the convergence loop at rigor=full) are verified at the next gate. sprint-retro at S6 is the final safety net — it harvests any skipped inline memory write-back into memory/<role>/<change-name>.md (one file per change, so parallel branches never conflict on a shared memory file).

Every write-back also appends one line to memory/<role>/_index.md — a per-role digest roles read FIRST (cheap, flat cost no matter how much history has accumulated), opening individual {change-name}.md files only for entries that look relevant. And a scope axis (tiny/standard, independent of type/rigor) scales how much a phase that DOES run produces — condensed design.md sections, affected-tests-only at intermediate checkpoints — never which phases/gates run. A separate test_scope axis (module/full, derived from rigor) bounds how WIDE the developer's final checkpoint and QA's independent re-run reach — module by default, restricting the test suite to the module/directory touched instead of the whole app. See sdlc-orchestration-core SKILL.md §Scope / §Test scope / §Role-memory index for the full resolution rules.

How context maps to each agent (Kiro only)

Claude does not use a context map — CLAUDE.md holds a role × file table and each role prompt Reads only its own context/*.md files; skills are auto-discovered. This section applies to Kiro only.

.kiro/context-map.json declares, per agent, which skills + context files + project doc folders it consumes. The mapper regenerates each agent's resources[] from it, skipping anything that doesn't exist (so references never break):

"architect": {
  "skills": ["cross-artifact-audit", "api-design"],
  "knowledgeBase": ["ai", "context/stack.md", "context/architecture.md", "context/conventions.md"]
},
"extraDocs": { "architect": ["docs/architecture"] }   // optional project doc folders

Edit the map (or let the onboarder do it), then node .kiro/tools/context-map.mjs. Never hand-edit resources[] in an agent JSON — it gets overwritten.

Pipeline config

sdlc.config.json (shared root) tunes pipeline behavior per project — no prompt edits needed. Keys: gates.auto_pass, coverage.{diff,lines,branches}_threshold, security.stride_analysis (auto/always/never), test_framework, sonar_scan, git.{isolation,branch_naming,protected_branches,…}, and paths.{code_roots,test_roots} (extend the developer/qa write-fence). The orchestrator honors gates.auto_pass + git.*; developer honors coverage.*; analyst/qa honor security.stride_analysis. (On Kiro it is loaded into every agent via context-map always; on Claude it is read by the orchestrator + guards.) pipelines.json (also shared root) defines the phases/gates/lifecycle once and the per-type phase lists — edit a type to tune it per project.

Notes

  • agents/examples/ are illustrative format samples (a reference domain); only their structure is meant to be reused. Replace with your own over time.
  • Workspace = OpenSpec: features are OpenSpec changes at openspec/changes/<name>/ (proposal + spec deltas + design + tasks); the orchestrator drives the lifecycle openspec new change → /opsx:apply → openspec archive across S1–S6, and archive folds the change's spec deltas into the living openspec/specs/. The onboarder mirrors the context contract into openspec/config.yaml so OpenSpec's own skills are project-aware.
  • openspec/ and memory/ are per-project workspace and are never shipped by the kit.
  • To pull kit updates, re-run init --force — see GUIDE.md § Updating.

About

sdlc kit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages