agentic-sdlc-mcp 1.3.0 → 1.4.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 (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +233 -240
  3. package/dist/config.d.ts +4 -3
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +117 -23
  6. package/dist/config.js.map +1 -1
  7. package/dist/github/context.d.ts +41 -0
  8. package/dist/github/context.d.ts.map +1 -1
  9. package/dist/github/context.js +191 -3
  10. package/dist/github/context.js.map +1 -1
  11. package/dist/index.js +4 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/tools/agent-handoff.d.ts +5 -41
  14. package/dist/tools/agent-handoff.d.ts.map +1 -1
  15. package/dist/tools/branch-protection-status.d.ts +17 -25
  16. package/dist/tools/branch-protection-status.d.ts.map +1 -1
  17. package/dist/tools/create-issue-set.d.ts +6 -46
  18. package/dist/tools/create-issue-set.d.ts.map +1 -1
  19. package/dist/tools/create-pr-summary.d.ts +3 -11
  20. package/dist/tools/create-pr-summary.d.ts.map +1 -1
  21. package/dist/tools/plan-from-context.d.ts +65 -32
  22. package/dist/tools/plan-from-context.d.ts.map +1 -1
  23. package/dist/tools/plan-from-context.js +545 -61
  24. package/dist/tools/plan-from-context.js.map +1 -1
  25. package/dist/tools/prepare-work-item.d.ts +6 -30
  26. package/dist/tools/prepare-work-item.d.ts.map +1 -1
  27. package/dist/tools/quality-gate-status.d.ts +11 -107
  28. package/dist/tools/quality-gate-status.d.ts.map +1 -1
  29. package/dist/tools/release-readiness.d.ts +8 -15
  30. package/dist/tools/release-readiness.d.ts.map +1 -1
  31. package/dist/tools/repo-context.d.ts +21 -30
  32. package/dist/tools/repo-context.d.ts.map +1 -1
  33. package/dist/tools/repo-context.js +86 -4
  34. package/dist/tools/repo-context.js.map +1 -1
  35. package/dist/tools/review-pr.d.ts +20 -28
  36. package/dist/tools/review-pr.d.ts.map +1 -1
  37. package/dist/tools/security-triage.d.ts +12 -46
  38. package/dist/tools/security-triage.d.ts.map +1 -1
  39. package/dist/tools/workflow-permissions-audit.d.ts +16 -24
  40. package/dist/tools/workflow-permissions-audit.d.ts.map +1 -1
  41. package/dist/types.d.ts +6 -0
  42. package/dist/types.d.ts.map +1 -1
  43. package/package.json +9 -9
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SakuraCianna
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,346 +1,339 @@
1
- # agentic-sdlc-mcp
1
+ <p align="center">
2
+ <img src="assets/logo.svg" alt="MCP Logo" width="120"/>
3
+ </p>
2
4
 
3
- [![CI](https://github.com/SakuraCianna/agentic-sdlc-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/SakuraCianna/agentic-sdlc-mcp/actions/workflows/ci.yml)
5
+ <h1 align="center">Agentic SDLC Control Plane (agentic-sdlc-mcp)</h1>
4
6
 
5
- An MCP (Model Context Protocol) Server that acts as an **Agentic SDLC Control Plane** — helping AI coding agents plan, create, test, review, secure, and release software following GitHub Agentic AI best practices.
7
+ <p align="center">
8
+ <b>Expose professional, structured SDLC workflows as MCP tools to guide AI coding agents (Claude, Cursor, etc.) through safe, auditable development lifecycles.</b>
9
+ </p>
6
10
 
7
- - GitHub: [SakuraCianna/agentic-sdlc-mcp](https://github.com/SakuraCianna/agentic-sdlc-mcp)
8
- - Issues: [github.com/SakuraCianna/agentic-sdlc-mcp/issues](https://github.com/SakuraCianna/agentic-sdlc-mcp/issues)
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/agentic-sdlc-mcp"><img src="https://img.shields.io/npm/v/agentic-sdlc-mcp.svg?style=flat-square&color=blue" alt="npm version"></a>
13
+ <a href="https://github.com/SakuraCianna/agentic-sdlc-mcp/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/SakuraCianna/agentic-sdlc-mcp/ci.yml?branch=main&style=flat-square" alt="CI status"></a>
14
+ <a href="https://www.npmjs.com/package/agentic-sdlc-mcp"><img src="https://img.shields.io/npm/dm/agentic-sdlc-mcp.svg?style=flat-square&color=green" alt="downloads"></a>
15
+ <a href="https://github.com/SakuraCianna/agentic-sdlc-mcp/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/agentic-sdlc-mcp.svg?style=flat-square&color=orange" alt="license"></a>
16
+ <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-Compatible-blue?style=flat-square" alt="MCP Compatible"></a>
17
+ </p>
9
18
 
10
19
  ---
11
20
 
12
- ## What Is This?
21
+ ## 💡 What Is This?
13
22
 
14
- `agentic-sdlc-mcp` is not a simple GitHub API wrapper. It is a **SDLC orchestration layer** that exposes structured, agent-friendly tools aligned to the full software development lifecycle:
23
+ Traditional AI agents write code but often lack the context of software engineering discipline. They might force-push, bypass reviews, fail to run CI, leak secrets, or skip writing test cases.
15
24
 
16
- ```
17
- Plan -> Create -> Test -> Review -> Optimize -> Secure
18
- ```
25
+ `agentic-sdlc-mcp` is an **SDLC orchestration layer and control plane** built on the **Model Context Protocol (MCP)**. It wraps GitHub APIs into high-level, opinionated tools that enforce traceability, human-in-the-loop gates, quality thresholds, and security checks for AI coding agents.
19
26
 
20
- **Safety first:** All write operations default to `dryRun: true`. Destructive or irreversible operations are never silently executed.
27
+ ### The Agentic SDLC Loop
28
+ ```mermaid
29
+ graph TD
30
+ A[Phase 1: Plan] -->|Exposed context & briefs| B[Phase 2: Create]
31
+ B -->|Incremental commits| C[Phase 3: Test]
32
+ C -->|Local test reports| D[Phase 4: Review]
33
+ D -->|Human review gate| E[Phase 5: Optimize]
34
+ E -->|Refinement| F[Phase 6: Secure]
35
+ F -->|Security check | G[Human Release Approval]
36
+ G -->|Release Tag & deploy| A
37
+ ```
21
38
 
22
39
  ---
23
40
 
24
- ## Installation
41
+ ## 🛠️ Tools Categorization
25
42
 
26
- **Requirements:** Node.js >= 24 (see `engines` in `package.json`; CI runs on Node 24).
43
+ Instead of exposing raw API endpoints, this server provides **12 specialized tools** structured around the SDLC pipeline:
27
44
 
28
- ```powershell
29
- # Clone the repository
30
- git clone https://github.com/SakuraCianna/agentic-sdlc-mcp.git
31
- cd agentic-sdlc-mcp
45
+ | Category | Tools | Description |
46
+ |---|---|---|
47
+ | **💡 Planning & Context** | [`repo_context`](#repo_context)<br>[`plan_from_context`](#plan_from_context)<br>[`prepare_work_item`](#prepare_work_item) | Understand the codebase, structure phase-by-phase plans, and generate agent briefs. |
48
+ | **🚀 Execution** | [`create_issue_set`](#create_issue_set) | Batch-create GitHub issues mapping directly to the SDLC plan. |
49
+ | **🔍 Review & Verification** | [`quality_gate_status`](#quality_gate_status)<br>[`create_pr_summary`](#create_pr_summary)<br>[`review_pr_against_standard`](#review_pr_against_standard) | Audit CI checks, generate structured PR summaries, and review code against SDLC standard levels. |
50
+ | **🛡️ Governance & Security** | [`branch_protection_status`](#branch_protection_status)<br>[`workflow_permissions_audit`](#workflow_permissions_audit)<br>[`security_triage`](#security_triage)<br>[`release_readiness_check`](#release_readiness_check) | Query branch rule enforcement, audit Actions workflow permissions, triage vulnerabilities, and perform pre-release checks. |
51
+ | **🤝 Handoff & Continuity** | [`agent_handoff_packet`](#agent_handoff_packet) | Compile a packet so other agents can seamlessly take over the work. |
32
52
 
33
- # Install dependencies
34
- npm install
53
+ ---
35
54
 
36
- # Build
37
- npm run build
55
+ ## 🗺️ System Architecture
56
+ ```mermaid
57
+ sequenceDiagram
58
+ autonumber
59
+ actor Developer as Human Owner
60
+ participant Agent as AI Coding Agent (Cursor/Claude)
61
+ participant MCP as agentic-sdlc-mcp (Control Plane)
62
+ participant GitHub as GitHub API
63
+ participant npm as npm Registry
64
+
65
+ Developer->>Agent: "Create a feature for repo X"
66
+ Agent->>MCP: Call repo_context / plan_from_context
67
+ MCP->>GitHub: Fetch repository states & file tree
68
+ GitHub-->>MCP: Repo Metadata & Files
69
+ MCP-->>Agent: SDLC Plan & context brief
70
+ Note over Agent: Agent develops code...
71
+ Agent->>MCP: Call review_pr_against_standard / quality_gate_status
72
+ MCP->>GitHub: Audit pull request, CODEOWNERS, & checks status
73
+ GitHub-->>MCP: PR approvals, CI check status
74
+ MCP-->>Agent: Verification report & findings
75
+ Note over Developer,Agent: Human Review Gate: Merge PR
76
+ Developer->>MCP: Trigger gh release create v1.3.0
77
+ MCP->>GitHub: Create Release Tag
78
+ GitHub->>GitHub: Trigger publish.yml Workflow (OIDC)
79
+ GitHub->>npm: Publish package (Signed with provenance)
38
80
  ```
39
81
 
40
82
  ---
41
83
 
42
- ## Environment Variables
84
+ ## 📋 Prerequisites
43
85
 
44
- Copy `.env.example` to `.env` and fill in your values:
86
+ Before running the server, ensure you have:
87
+ 1. **Node.js >= 24** installed on your system.
88
+ 2. **GitHub Personal Access Token (PAT)**:
89
+ * **Scopes required**:
90
+ * `repo` (Full control of private/public repositories, issues, PRs, and checks).
91
+ * `security_events` (To query Code Scanning and Dependabot alerts).
92
+ * Note: Make sure to verify token permissions against [GitHub REST API Documentation](https://docs.github.com/en/rest) if security endpoints fail.
45
93
 
46
- ```powershell
47
- Copy-Item .env.example .env
48
- ```
94
+ ---
49
95
 
50
- Then edit `.env` — it is loaded automatically by `dotenv` when the server starts.
96
+ ## ⚡ Quick Start
51
97
 
52
- Alternatively, set variables inline in PowerShell:
98
+ ### 1. Instant Run via npx (Recommended)
99
+ You do not need to download or clone the repository. Run the server directly inside your MCP client environment:
100
+ ```bash
101
+ npx -y agentic-sdlc-mcp
102
+ ```
53
103
 
54
- ```powershell
55
- $env:GITHUB_TOKEN = "ghp_your_token_here"
56
- $env:GITHUB_OWNER = "your-org"
57
- $env:GITHUB_REPO = "your-repo"
104
+ ### 2. Global Installation
105
+ Or install the package globally on your system:
106
+ ```bash
107
+ npm install -g agentic-sdlc-mcp
108
+ # Start using the global command
109
+ agentic-sdlc-mcp
58
110
  ```
59
111
 
60
- | Variable | Required | Description |
61
- |---|---|---|
62
- | `GITHUB_TOKEN` | Yes | GitHub PAT or App token |
63
- | `GITHUB_OWNER` | Optional | Default owner (org or user) |
64
- | `GITHUB_REPO` | Optional | Default repository name |
65
- | `SDLC_DEFAULT_BRANCH` | Optional | Default branch (default: `main`) |
66
- | `TRANSPORT` | Optional | `stdio` (default) or `http` |
67
- | `PORT` | Optional | HTTP port (default: `3000`) |
112
+ ### 3. Local Development (From Source)
113
+ If you want to run or extend the server locally from the source code:
114
+ ```bash
115
+ git clone https://github.com/SakuraCianna/agentic-sdlc-mcp.git
116
+ cd agentic-sdlc-mcp
117
+ npm install
118
+ npm run build
119
+ node dist/index.js
120
+ ```
68
121
 
69
- ### Required GitHub Token Scopes
122
+ ---
70
123
 
71
- | Scope | Purpose |
72
- |---|---|
73
- | `repo` | Read/write issues, PRs, file contents, checks (or `public_repo` for public-only repos) |
74
- | `security_events` | Code Scanning and Dependabot alerts (or `public_repo` for public-only repos) |
75
- | `repo` or `security_events` | Secret Scanning alerts |
124
+ ## ✅ Generic AI Coding Agent Smoke Test
76
125
 
77
- > Verified against GitHub's REST API reference (Dependabot alerts, Code Scanning alerts, Secret Scanning alerts, Checks endpoints) as of this writing. GitHub's scope requirements can change — see the [REST API docs](https://docs.github.com/en/rest) if a tool reports a permission error that doesn't match this table.
126
+ If you need to verify this MCP server in any MCP-capable AI coding agent, follow the client-neutral guide in [`docs/ai-coding-agent-smoke-test.md`](docs/ai-coding-agent-smoke-test.md). It covers the minimum configuration, repository fallback behavior, `repo_context` read-only validation, and `create_issue_set` dry-run preview without creating GitHub issues.
78
127
 
79
128
  ---
80
129
 
81
- ## MCP Client Configuration
130
+ ## ⚙️ MCP Client Configuration
82
131
 
83
- ### Claude Desktop / Kiro / Cursor
84
-
85
- Add to your MCP client config (`claude_desktop_config.json` or equivalent):
132
+ Add this server configuration to your MCP client setting files (e.g., `claude_desktop_config.json`, Cursor, or Windsurf settings):
86
133
 
134
+ ### Claude Desktop / Cursor / Windsurf (Using npm package)
87
135
  ```json
88
136
  {
89
137
  "mcpServers": {
90
138
  "agentic-sdlc": {
91
- "command": "node",
92
- "args": ["E:/CodeHome/agentic-sdlc-mcp/dist/index.js"],
139
+ "command": "npx",
140
+ "args": ["-y", "agentic-sdlc-mcp"],
93
141
  "env": {
94
- "GITHUB_TOKEN": "ghp_your_token",
95
- "GITHUB_OWNER": "your-org",
96
- "GITHUB_REPO": "your-repo"
142
+ "GITHUB_TOKEN": "REPLACE_WITH_GITHUB_TOKEN",
143
+ "GITHUB_OWNER": "your-github-username-or-org",
144
+ "GITHUB_REPO": "your-target-repository"
97
145
  }
98
146
  }
99
147
  }
100
148
  }
101
149
  ```
102
150
 
103
- Use forward slashes or escaped backslashes for Windows paths.
104
-
105
- ---
106
-
107
- ## Running the Server
151
+ ### 🔑 Global Configuration & Interactive Setup (Persistent)
108
152
 
109
- ### stdio mode (default — for MCP clients)
153
+ In addition to specifying environment variables in your MCP client configurations, you can configure your GitHub credentials globally using an interactive terminal questionnaire. The settings will be saved to `~/.agentic-sdlc-mcp.json` under your home directory and automatically loaded in subsequent runs.
110
154
 
111
- ```powershell
112
- $env:GITHUB_TOKEN = "ghp_your_token"
113
- node dist/index.js
155
+ #### 1. Configure via CLI
156
+ Run the configuration command:
157
+ ```bash
158
+ npx agentic-sdlc-mcp configure
114
159
  ```
160
+ This guides you through configuring:
161
+ * `GITHUB_TOKEN` (Primary token; [generate classic token here](https://github.com/settings/tokens) with `repo` and `read:org` scopes)
162
+ * `GITHUB_OWNER` (Default repository owner name, optional)
163
+ * `GITHUB_REPO` (Default repository name, optional)
115
164
 
116
- ### HTTP mode (for remote / multi-client use)
165
+ #### 2. Automatic Setup Prompts (TTY)
166
+ If you run `npx -y agentic-sdlc-mcp` directly without a configured `GITHUB_TOKEN`, the tool detects if it is in an interactive environment (TTY) and automatically launches the prompt flow. If it runs non-interactively (e.g. launched by Claude Desktop in the background), it exits gracefully with clear setup instructions.
117
167
 
168
+ #### 3. Global Environment Variables (Fallback)
169
+ You can still define environment variables directly in your terminal shell (`PowerShell` for Windows or `bash` for macOS/Linux):
118
170
  ```powershell
119
- $env:TRANSPORT = "http"
120
- $env:PORT = "3000"
121
- $env:GITHUB_TOKEN = "ghp_your_token"
122
- node dist/index.js
123
- # Server listens at http://localhost:3000/mcp
124
- ```
125
-
126
- ### Smoke test (no real token required)
127
-
128
- Verifies the module loads cleanly and all tools register without error:
129
-
130
- ```powershell
131
- npm run smoke
132
- # Output: [agentic-sdlc-mcp] SMOKE OK — all tools and resources registered successfully.
171
+ # Windows PowerShell
172
+ $env:GITHUB_TOKEN = "REPLACE_WITH_GITHUB_TOKEN"
173
+ $env:GITHUB_OWNER = "your-org"
174
+ $env:GITHUB_REPO = "your-repo"
133
175
  ```
134
176
 
135
177
  ---
136
178
 
137
- ## npm Scripts
179
+ ## 🎯 Typical Scenarios & Best Practices
138
180
 
139
- | Script | Description |
140
- |---|---|
141
- | `npm run build` | Compile TypeScript to `dist/` |
142
- | `npm run typecheck` | Type-check without emitting |
143
- | `npm run test` | Run the Vitest test suite |
144
- | `npm run test:watch` | Watch mode for TDD |
145
- | `npm run test:coverage` | Coverage report (lcov + text) |
146
- | `npm run smoke` | Smoke-test: load + register, no real token needed |
147
- | `npm run dev` | Watch mode with tsx (development) |
148
- | `npm start` | Run the compiled server |
181
+ AI agents should not run commands blindly or write code without structure. This control plane enforces software engineering discipline. Below are the recommended agent-collaboration patterns:
149
182
 
150
- ---
183
+ ### Scenario 1: Bootstrapping a Feature / Fix
184
+ When an agent starts a task, it must follow this checklist to prevent "blind coding":
185
+ 1. **Gather Context**: Call [`repo_context`](#repo_context) to check current issues, PRs, and branch states.
186
+ 2. **Design a Plan**: Call [`plan_from_context`](#plan_from_context) with the task goal. This will outline structured issues corresponding to SDLC phases (Plan, Create, Test, Review, Optimize, Secure).
187
+ 3. **Write Issues**: Call [`create_issue_set`](#create_issue_set) with `dryRun: false` to publish the checklist directly to GitHub.
188
+ 4. **Acquire Work Brief**: Call [`prepare_work_item`](#prepare_work_item) on the active issue to retrieve precise guidelines, scope definitions, and related files.
151
189
 
152
- ## MCP Inspector (smoke test / exploration)
190
+ ### Scenario 2: Guarding the Pull Request Gate
191
+ Before submitting a PR for human review, the agent must verify its own quality:
192
+ 1. **Generate PR Summary**: Call [`create_pr_summary`](#create_pr_summary) to auto-generate structured, professional release notes and file diff changes.
193
+ 2. **Audit CI Status**: Call [`quality_gate_status`](#quality_gate_status) to ensure all GitHub Actions tests and linting check runs are passing green.
194
+ 3. **Execute Static Audit**: Call [`review_pr_against_standard`](#review_pr_against_standard) with `standard: "strict"` or `"security-focused"` to scan diffs for key leaks, verify `.env` safety, and ensure `.github/CODEOWNERS` reviewers are correctly assigned.
153
195
 
154
- ```powershell
155
- $env:GITHUB_TOKEN = "ghp_your_token"
156
- npx @modelcontextprotocol/inspector node dist/index.js
157
- ```
196
+ ### Scenario 3: Release Readiness Check
197
+ When preparation is complete and a release is requested:
198
+ 1. **Vulnerability Check**: Call [`security_triage`](#security_triage) to audit Code Scanning (SAST), Dependabot, and Secret Scanning. Ensure no critical alerts block the release.
199
+ 2. **Release Readiness**: Call [`release_readiness_check`](#release_readiness_check) to generate a rollback plan template, verify there are no open release-blocking issues, and ensure CHANGELOG.md is up to date.
200
+ 3. **Handoff**: If transferring deployment duties to another agent, call [`agent_handoff_packet`](#agent_handoff_packet) to pass along the complete audit log.
158
201
 
159
202
  ---
160
203
 
161
- ## Tools Reference
204
+ ## 📖 Tools Reference
205
+
206
+ Detailed specifications of the exposed MCP tools.
162
207
 
163
208
  ### `repo_context`
164
- Read repository metadata, README, package.json, open issues, and open PRs.
165
- Use at the start of every workflow.
166
- - `issueLimit` / `prLimit` (number, default: `20`, max: `100`): cap how many open issues/PRs are fetched, to avoid token-heavy responses on large repos.
209
+ Reads repository metadata, README, package.json, open issues, and open PRs. Optionally acts as a fuller "repository briefing packet" -- detected package manager, tech stack, common verification scripts, workflow file names, lightweight governance signals, and agent instruction file summaries (e.g. `AGENTS.md`, `CLAUDE.md`). Use this at the start of any workflow to orient the agent.
210
+ * **Arguments:**
211
+ * `owner` (string, optional): GitHub owner.
212
+ * `repo` (string, optional): GitHub repo.
213
+ * `includeReadme` (boolean, default: `true`): Include a truncated README summary.
214
+ * `includePackageJson` (boolean, default: `false`): Include package.json summary, detected package manager (npm/pnpm/yarn/bun), tech stack, and common scripts (build/test/typecheck/lint/smoke/...).
215
+ * `includeWorkflows` (boolean, default: `false`): Include `.github/workflows/*.yml` file names (names only -- use `workflow_permissions_audit` for permission contents).
216
+ * `includeAgentInstructions` (boolean, default: `false`): Include summaries of agent instruction files found at the repo root (`AGENTS.md`, `CLAUDE.md`).
217
+ * `includeGovernance` (boolean, default: `false`): Include whether a CODEOWNERS file exists (for full branch protection details, use `branch_protection_status`).
218
+ * `includeOpenIssues` / `includeOpenPRs` (boolean, default: `false`): Include recent open issues/PRs.
219
+ * `issueLimit` / `prLimit` (number, default: `20`, max: `100`): Cap how many issues/PRs are fetched.
220
+ * `maxReadmeChars` (number, default: `3000`): Max README characters before truncation.
221
+ * `maxInstructionChars` (number, default: `1000`): Max characters per agent instruction file summary before truncation.
167
222
 
168
223
  ### `plan_from_context`
169
- Generate a phase-by-phase SDLC plan (Plan→Create→Test→Review→Optimize→Secure).
170
- Template-based — no LLM call needed.
224
+ Generates a structured, phase-by-phase SDLC plan matching the standard milestones, tailored to a `workType`. Each work type gets a materially different plan -- e.g. `docs` never defaults to requiring code unit tests, `bugfix` always includes repro + regression tests, `security` always includes a threat model and least-privilege review, and `release`/`infra` always include changelog/rollback and workflow-permission checks respectively.
225
+ * **Arguments:**
226
+ * `owner` / `repo` (string, optional): Repo coordinates.
227
+ * `goal` (string, required): The target feature or fix description.
228
+ * `workType` (string, optional): One of `docs` / `feature` / `bugfix` / `refactor` / `security` / `release` / `infra`. If omitted, it is inferred from `goal` + `acceptanceCriteria` via a conservative keyword heuristic -- the response's `confidence` (`high`/`medium`/`low`) and `needsClarification` fields tell you whether to trust the guess or pass `workType` explicitly.
229
+ * `constraints` (string[], optional): Technical or business constraints.
230
+ * `acceptanceCriteria` (string[], optional): Explicit acceptance criteria (also used for workType inference).
171
231
 
172
232
  ### `create_issue_set`
173
- Batch-create GitHub issues from a plan.
174
- ⚠️ `dryRun` defaults to `true` — pass `dryRun: false` to write to GitHub.
233
+ Batch-creates GitHub issues mapping to the generated plan.
234
+ * **Arguments:**
235
+ * `owner` / `repo` (string, optional): Repo coordinates.
236
+ * `issues` (array of objects, required): Structured list of issues to create (title, body, labels).
237
+ * `dryRun` (boolean, default: `true`): If `true`, previews the list without writing to GitHub.
175
238
 
176
239
  ### `prepare_work_item`
177
- Generate an agent-ready brief for a specific issue: goals, non-goals, acceptance criteria, risks, and a handoff prompt.
178
- - `includeRelatedFiles` (boolean, default: `false`): heuristically extract file paths mentioned in the issue body.
179
- - `includeRecentPRs` (boolean, default: `false`): scan up to 20 recently-updated closed PRs and return up to 5 merged ones that touched the related file hints (requires `includeRelatedFiles` to have found hints — returns an empty list otherwise). Output field: `recentPRs`.
240
+ Generates an agent-ready brief for a specific issue containing goals, non-goals, and technical risks.
241
+ * **Arguments:**
242
+ * `owner` / `repo` (string, optional): Repo coordinates.
243
+ * `issueNumber` (number, required): The target issue ID.
244
+ * `includeRelatedFiles` (boolean, default: `false`): Heuristically extract mentioned file paths.
245
+ * `includeRecentPRs` (boolean, default: `false`): Scan up to 5 merged PRs that touched these paths.
180
246
 
181
247
  ### `quality_gate_status`
182
- Read check-run results for a PR or git ref.
183
- Use to verify CI before merging or releasing.
248
+ Audits the check-runs (CI status, build status, linting status) for a given PR or git ref.
249
+ * **Arguments:**
250
+ * `owner` / `repo` (string, optional): Repo coordinates.
251
+ * `pullNumber` (number, optional): Query checks by PR number.
252
+ * `ref` (string, optional): Query checks by branch, tag, or SHA.
184
253
 
185
254
  ### `create_pr_summary`
186
- Generate a structured PR summary: change overview, file categories, test coverage signals, risks, review checklist, and release notes draft.
255
+ Generates a structured pull request description and changelog draft.
256
+ * **Arguments:**
257
+ * `owner` / `repo` (string, optional): Repo coordinates.
258
+ * `pullNumber` (number, required): The pull request ID.
187
259
 
188
260
  ### `review_pr_against_standard`
189
- Review a PR against SDLC standards (`basic` / `strict` / `security-focused`).
190
- `security-focused` mode scans actual patch lines for secret patterns, `.env` files, lockfile changes, and dist files.
191
- - `checkOwnership` (boolean, default: `true`): match changed files against `.github/CODEOWNERS` (or `CODEOWNERS` / `docs/CODEOWNERS`) and flag any matched owner who is neither the PR author, a requested reviewer, nor an actual reviewer. No finding is raised if no CODEOWNERS file exists — see the `codeownersFound` output field.
261
+ Reviews pull request code changes against SDLC governance levels (`basic` / `strict` / `security-focused`).
262
+ * **Arguments:**
263
+ * `owner` / `repo` (string, optional): Repo coordinates.
264
+ * `pullNumber` (number, required): The pull request ID.
265
+ * `standard` (string, default: `"basic"`): Standard level.
266
+ * `checkOwnership` (boolean, default: `true`): Validates file ownership changes against `.github/CODEOWNERS` and flags unassigned reviewers.
192
267
 
193
268
  ### `security_triage`
194
- Read Code Scanning, Dependabot, and Secret Scanning alerts, triage by severity, recommend fix order.
269
+ Retrieves and triages Code Scanning, Dependabot, and Secret Scanning alerts.
270
+ * **Arguments:**
271
+ * `owner` / `repo` (string, optional): Repo coordinates.
195
272
 
196
273
  ### `release_readiness_check`
197
- Pre-release assessment: CI status, open bugs, CHANGELOG, release checklist, rollback template.
198
-
199
- ### `agent_handoff_packet`
200
- Generate a compact handoff packet so another agent can continue work without losing context.
274
+ Assesses pre-release health (tests, open bugs, changelogs) and generates rollback instructions.
275
+ * **Arguments:**
276
+ * `owner` / `repo` (string, optional): Repo coordinates.
277
+ * `headRef` (string, optional): Target release branch/tag.
201
278
 
202
279
  ### `branch_protection_status`
203
- Read classic branch protection AND repository rulesets for a branch (defaults to the repo's default branch).
204
- Flags missing required reviews, missing required status checks, allowed force pushes/deletions, and CODEOWNERS reviews not being enforced.
280
+ Queries classic branch protection and repository rulesets for required reviews, status checks, and push limits.
281
+ * **Arguments:**
282
+ * `owner` / `repo` (string, optional): Repo coordinates.
283
+ * `branch` (string, optional): Target branch. Defaults to default branch.
205
284
 
206
285
  ### `workflow_permissions_audit`
207
- Scan `.github/workflows/*.yml` (and `.yaml`) for `permissions` declarations (top-level and per-job) and flag least-privilege gaps.
208
- - `owner` / `repo` (string, optional): Repository coordinates. Falls back to GITHUB_OWNER / GITHUB_REPO.
209
- - `ref` (string, optional): Branch, tag, or SHA to read workflow files from. Falls back to the repository's default branch.
210
-
211
- ---
286
+ Scans `.github/workflows/*.yml` files for `permissions` blocks and flags over-permissioned tokens.
287
+ * **Arguments:**
288
+ * `owner` / `repo` (string, optional): Repo coordinates.
289
+ * `ref` (string, optional): Git ref. Defaults to default branch.
212
290
 
213
- ## Resources
214
-
215
- | URI | Description |
216
- |---|---|
217
- | `sdlc://standards/agentic-sdlc` | Full Agentic SDLC standard with phases and human gates |
218
- | `sdlc://templates/issue` | Standard issue template |
219
- | `sdlc://templates/pr-summary` | Standard PR summary template |
220
- | `sdlc://templates/release-readiness` | Pre-release checklist template |
221
- | `sdlc://templates/handoff` | Agent handoff template |
291
+ ### `agent_handoff_packet`
292
+ Compiles current issue context, completed work, and remaining tasks into a compact prompt packet for the next agent.
293
+ * **Arguments:**
294
+ * `owner` / `repo` (string, optional): Repo coordinates.
295
+ * `issueNumber` (number, required): Active issue ID.
222
296
 
223
297
  ---
224
298
 
225
- ## dryRun Safety Model
299
+ ## 📚 Resources Reference
226
300
 
227
- All write tools implement `dryRun`:
301
+ The server exposes read-only static resources under the `sdlc://` schema for quick agent guidance:
228
302
 
229
- | `dryRun` | Effect |
303
+ | Resource URI | Description |
230
304
  |---|---|
231
- | `true` (default) | Preview mode — no GitHub API writes |
232
- | `false` | Live mode — actually writes to GitHub |
233
-
234
- The default is always `dryRun: true`. Agents must explicitly pass `dryRun: false`.
305
+ | `sdlc://standards/agentic-sdlc` | Full Markdown specification of the Agentic SDLC Standard. |
306
+ | `sdlc://templates/issue` | Markdown template for creating structured GitHub issues. |
307
+ | `sdlc://templates/pr-summary` | Markdown template for PR descriptions and changelogs. |
308
+ | `sdlc://templates/release-readiness` | Checklist for pre-release audits. |
309
+ | `sdlc://templates/handoff` | Prompt packet template for agent handoffs. |
235
310
 
236
311
  ---
237
312
 
238
- ## Workflow Examples
239
-
240
- ### 1. Start a new feature
313
+ ## 🔒 Safety Defaults & `dryRun` Model
241
314
 
242
- ```
243
- 1. repo_context # understand the codebase
244
- 2. plan_from_context (goal=...) # generate SDLC plan
245
- 3. create_issue_set (dryRun:true) # preview issues
246
- 4. create_issue_set (dryRun:false) # create issues
247
- 5. prepare_work_item (issueNumber=N) # get agent brief
248
- ```
315
+ To prevent AI coding agents from performing destructive or unintended actions on production repositories, this control plane enforces:
249
316
 
250
- ### 2. Review a pull request
251
-
252
- ```
253
- 1. create_pr_summary (pullNumber=N) # diff overview
254
- 2. quality_gate_status (pullNumber=N) # CI check
255
- 3. review_pr_against_standard (standard:strict) # findings
256
- ```
257
-
258
- ### 3. Pre-release check
259
-
260
- ```
261
- 1. security_triage # check alerts
262
- 2. release_readiness_check # full readiness
263
- 3. (fix blocking issues)
264
- 4. Human approval before tagging release
265
- ```
317
+ * **Preview by Default (`dryRun: true`)**: All tools that write data (like `create_issue_set`) run in preview mode by default. Writing requires explicitly passing `dryRun: false`.
318
+ * **Zero Self-Merge Policy**: No tools exist to auto-merge pull requests. Human approval is required on all merge gates.
319
+ * **Access Restraints**: The server does not support force-pushing or deleting branch rules.
320
+ * **CODEOWNERS Enforced Review**: Special paths (such as workflows under `.github/` and core files under `src/`) require owner approvals.
266
321
 
267
322
  ---
268
323
 
269
- ## Security
270
-
271
- - Never commit your `GITHUB_TOKEN` — use `.env` or PowerShell `$env:` variables
272
- - `dryRun: true` by default prevents accidental writes
273
- - No auto-merge, no force-push, no branch deletion
274
- - Secret scanning alerts are always rated `critical`
275
- - The server does not make outbound requests beyond the GitHub API
276
- - `.github/CODEOWNERS` routes review of high-risk paths (`.github/`, `src/github/`, `src/tools/`) to the maintainer
277
-
278
- ---
279
-
280
- ## Development
281
-
282
- ```powershell
283
- # Type check
284
- npm run typecheck
324
+ ## 📦 Developer Guide & npm Publishing
285
325
 
286
- # Watch mode
287
- npm run dev
326
+ ### Development Scripts
327
+ * `npm run typecheck`: Runs TypeScript compiler type checking.
328
+ * `npm run build`: Compiles TS files to the `dist/` directory.
329
+ * `npm run test`: Executes the unit test suite (214 test cases).
330
+ * `npm run smoke`: Verifies registration and loading without external credentials.
288
331
 
289
- # Build
290
- npm run build
291
-
292
- # Test
293
- npm run test
294
-
295
- # Smoke test (no token needed)
296
- npm run smoke
297
- ```
298
-
299
- ---
300
-
301
- ## Publishing (Maintainers)
302
-
303
- This package is published to npm using **Trusted Publishing (OIDC)** — no long-lived `NPM_TOKEN` secret is stored in the repo. Publishing is handled by `.github/workflows/publish.yml`.
304
-
305
- ### One-time setup on npmjs.com
306
-
307
- 1. Sign in to [npmjs.com](https://www.npmjs.com) and open the package's **Settings -> Publishing access**.
308
- 2. Add a **Trusted Publisher** with:
309
- - Provider: `GitHub Actions`
310
- - Repository: `SakuraCianna/agentic-sdlc-mcp`
311
- - Workflow filename: `publish.yml`
312
- 3. Save. From then on, `publish.yml` publishes without any npm token — GitHub issues a short-lived OIDC token that npm exchanges for a publish credential, and provenance is generated automatically.
313
-
314
- > First publish only: if the package name doesn't exist on npm yet, Trusted Publisher can't be linked until the package exists. In that case, do one manual `npm publish` from your machine with a classic token first, then configure Trusted Publishing for all subsequent releases. The `publish.yml` workflow itself always uses OIDC — it never falls back to a token.
315
-
316
- ### Triggering a publish
317
-
318
- - **Preferred:** create a GitHub Release (tag it, then "Publish release") — this fires `release: published` and runs `publish.yml` automatically.
319
- - **Manual:** go to **Actions -> Publish to npm -> Run workflow** (`workflow_dispatch`).
320
-
321
- ### Pre-publish checklist (run locally before tagging a release)
322
-
323
- ```powershell
324
- npm run typecheck
325
- npm run build
326
- npm run test
327
- npm run smoke
328
- npm run test:coverage
329
- npm pack --dry-run
330
- ```
331
-
332
- `npm pack --dry-run` prints exactly which files would ship in the published tarball, without creating one. Confirm only `dist/`, `README.md`, and `.env.example` are included — test files and `package-lock.json` must NOT appear (enforced by `tsconfig.build.json`, which excludes `src/__tests__/**` from the compiled `dist/` output used for publishing).
333
-
334
- ### GitHub Actions workflows
335
-
336
- | Workflow | Trigger | Purpose |
337
- |---|---|---|
338
- | `.github/workflows/ci.yml` | `pull_request`, `push` to `main` | Runs typecheck, build, test, smoke, and coverage on Node 24 |
339
- | `.github/workflows/publish.yml` | GitHub Release published, or manual dispatch | Publishes to npm via OIDC Trusted Publishing |
340
- | `.github/dependabot.yml` | Weekly schedule | Opens PRs for npm and GitHub Actions dependency updates (labelled `dependencies`) |
332
+ ### OIDC Trusted Publishing (For Maintainers)
333
+ This package is securely published to npm via GitHub Actions using **Trusted Publishing (OIDC)**, eliminating the need to store static `NPM_TOKEN` secrets in the repository. Publishing is triggered by creating a GitHub Release or manually running the Action.
341
334
 
342
335
  ---
343
336
 
344
- ## License
337
+ ## 📄 License
345
338
 
346
- MIT
339
+ Exposed under the [MIT License](LICENSE).
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Configuration loader — reads all settings from environment variables.
2
+ * Configuration loader — reads all settings from environment variables or global config file.
3
3
  * In smoke mode (--smoke flag or SMOKE=true) token validation is skipped.
4
4
  */
5
5
  export interface Config {
@@ -16,7 +16,8 @@ export interface Config {
16
16
  }
17
17
  /** True when --smoke CLI flag or SMOKE=true env var is set. */
18
18
  export declare const isSmokeMode: boolean;
19
- export declare function loadConfig(): Config;
20
- /** Singleton — loaded once at startup */
19
+ /** Singleton config instance — properties will be populated on initialization */
21
20
  export declare const config: Config;
21
+ /** Initializes the configuration. Exits early if required keys are missing and TTY is false. */
22
+ export declare function initializeConfig(): Promise<void>;
22
23
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,MAAM;IACrB,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,qCAAqC;IACrC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,0BAA0B;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,+DAA+D;AAC/D,eAAO,MAAM,WAAW,SAC6C,CAAC;AActE,wBAAgB,UAAU,IAAI,MAAM,CAmBnC;AAED,yCAAyC;AACzC,eAAO,MAAM,MAAM,EAAE,MAAqB,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA;;;GAGG;AAEH,MAAM,WAAW,MAAM;IACrB,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,qCAAqC;IACrC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,0BAA0B;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,+DAA+D;AAC/D,eAAO,MAAM,WAAW,SAC6C,CAAC;AAKtE,iFAAiF;AACjF,eAAO,MAAM,MAAM,EAAE,MAMpB,CAAC;AA2EF,gGAAgG;AAChG,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CA4CtD"}