@qball-inc/the-bulwark 1.0.0 → 1.1.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.
- package/.claude-plugin/plugin.json +2 -3
- package/LICENSE +21 -0
- package/README.md +408 -0
- package/hooks/hooks.json +11 -0
- package/package.json +1 -1
- package/scripts/hooks/enforce-quality.sh +70 -21
- package/scripts/hooks/suggest-pipeline-stop.sh +118 -0
- package/scripts/hooks/suggest-pipeline.sh +12 -0
- package/scripts/init.sh +8 -0
- package/scripts/install-just.sh +404 -0
- package/scripts/toolchain-smoke-run.sh +219 -0
- package/skills/bulwark-scaffold/SKILL.md +99 -33
- package/skills/init/SKILL.md +102 -6
- package/skills/session-handoff/SKILL.md +26 -0
- package/skills/test-audit/scripts/data-flow-analyzer.ts +1 -2
- package/skills/test-audit/scripts/skip-detector.ts +1 -1
- package/skills/test-audit/scripts/verification-counter.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "the-bulwark",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Full-lifecycle SDLC guardrailing framework for Claude Code — from product ideation and planning through implementation, code review, and test validation. Enterprise-grade skills and agents for AI-human peer collaboration.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ashay Kubal",
|
|
@@ -38,6 +38,5 @@
|
|
|
38
38
|
"test-coverage",
|
|
39
39
|
"statusline",
|
|
40
40
|
"agent-teams"
|
|
41
|
-
]
|
|
42
|
-
"hooks": "./hooks/hooks.json"
|
|
41
|
+
]
|
|
43
42
|
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ashay Kubal
|
|
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
ADDED
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/assets/bulwark-hero.png" alt="The Bulwark" width="200" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">The Bulwark</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
SDLC governance & enforcement for Claude Code.
|
|
9
|
+
<br />
|
|
10
|
+
Turn stochastic AI output into engineering-grade artifacts.
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="#quick-install">Install</a> ·
|
|
15
|
+
<a href="#how-it-works">How it works</a> ·
|
|
16
|
+
<a href="#hooks">Hooks</a> ·
|
|
17
|
+
<a href="#skill-registry">Skills</a> ·
|
|
18
|
+
<a href="#agent-registry">Agents</a> ·
|
|
19
|
+
<a href="#planned-enhancements">Roadmap</a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="https://www.npmjs.com/package/@qball-inc/the-bulwark"><img src="https://img.shields.io/npm/v/@qball-inc/the-bulwark?label=npm" alt="npm version" /></a>
|
|
24
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" /></a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
### If you find this useful, please give it a star. It helps others discover the project.
|
|
30
|
+
|
|
31
|
+
[](https://github.com/QBall-Inc/the-bulwark)
|
|
32
|
+
|
|
33
|
+
## What is The Bulwark?
|
|
34
|
+
|
|
35
|
+
The Bulwark is a [Claude Code plugin](https://docs.anthropic.com/en/docs/claude-code/plugins) that adds automated quality enforcement to your development workflow. It ships 28 skills, 15 custom agents, and a set of hooks that run programmatic checks on every code change you make.
|
|
36
|
+
|
|
37
|
+
The Bulwark is the culmination of close to 6 weeks and 100 sessions of intense planning & research, co-partnered by Claude and myself. The goal was straightforward: take everything I'd learned running Claude Code over 8 months and package it into a governance layer that actually enforces standards instead of suggesting them.
|
|
38
|
+
|
|
39
|
+
## Who is it for?
|
|
40
|
+
|
|
41
|
+
- Builders who want to stay in the driver's seat while giving Claude semi-autonomy over structured workflows
|
|
42
|
+
- Teams that need repeatable, auditable AI-assisted development
|
|
43
|
+
- Users on Claude Max & Enterprise plans (the multi-agent pipelines are token-intensive)
|
|
44
|
+
|
|
45
|
+
## Who is it not for?
|
|
46
|
+
|
|
47
|
+
- While it can be used by those who prefer to run `--dangerously-skip-permissions` on Claude Code, this plugin may work with slight modifications, I do not recommend it
|
|
48
|
+
- Users on Claude Free, Pro, or Pro Plus plans. The multi-agent orchestration burns through tokens fast, and rate limits on lower tiers will interrupt pipelines mid-execution.
|
|
49
|
+
|
|
50
|
+
## Why?
|
|
51
|
+
|
|
52
|
+
Claude Code is remarkably capable on its own. But capability without consistency is a problem.
|
|
53
|
+
|
|
54
|
+
Without guardrails, you get:
|
|
55
|
+
- Code that compiles but skips type checks, lint, or tests
|
|
56
|
+
- Reviews that miss security issues because a single pass can't cover everything
|
|
57
|
+
- Test suites full of mocks that verify function calls instead of real behavior
|
|
58
|
+
- Plans and estimates that vary wildly between sessions
|
|
59
|
+
|
|
60
|
+
The Bulwark fixes this by making enforcement automatic. Hooks run quality checks after every write. Skills orchestrate multi-agent pipelines where each agent has a single focus. Rules are injected at session start and enforced throughout. You don't have to remember to ask Claude to run tests or check types. It just happens.
|
|
61
|
+
|
|
62
|
+
## Quick install
|
|
63
|
+
|
|
64
|
+
Two ways to install. Pick whichever works for you.
|
|
65
|
+
|
|
66
|
+
### Option A: npm
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
claude /plugin install npm:@qball-inc/the-bulwark
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Option B: Marketplace
|
|
73
|
+
|
|
74
|
+
First, add the QBall-Inc marketplace (one-time setup):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
claude /plugin marketplace add QBall-Inc/plugins-market
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then install:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
claude /plugin install the-bulwark@qball-inc
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Post-install
|
|
87
|
+
|
|
88
|
+
After installing, restart your Claude Code session and run the init skill:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
/the-bulwark:init
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This walks you through a guided setup: Rules.md injection, CLAUDE.md configuration, and optional tooling (LSP, Justfile scaffolding, statusline). It auto-detects brownfield projects and adjusts accordingly.
|
|
95
|
+
|
|
96
|
+
> Having trouble installing? See [FAQ and troubleshooting](#faq-and-troubleshooting). If your issue isn't covered, please [open an issue](https://github.com/QBall-Inc/the-bulwark/issues).
|
|
97
|
+
|
|
98
|
+
## Prerequisites
|
|
99
|
+
|
|
100
|
+
| Requirement | Details |
|
|
101
|
+
|-------------|---------|
|
|
102
|
+
| Claude Code | Latest version recommended. Plugin support required. |
|
|
103
|
+
| Node.js | v18+ (for TypeScript tooling and `just` recipes) |
|
|
104
|
+
| [just](https://github.com/casey/just) | Command runner used for build/typecheck/lint recipes. `/the-bulwark:init` offers to install it for you. |
|
|
105
|
+
| Language Servers | TypeScript (`typescript-language-server`), Python (`pyright`), etc. The LSP setup within `/the-bulwark:init` will offer to install language servers for your project's languages. |
|
|
106
|
+
| Platform | Linux, macOS, WSL2. Native Windows is not tested. |
|
|
107
|
+
| Claude Plan | Max or Enterprise recommended. Pro Plus works for single-agent skills but will hit rate limits on multi-agent pipelines. |
|
|
108
|
+
|
|
109
|
+
## How it works
|
|
110
|
+
|
|
111
|
+
The Bulwark has different orchestration models for coding and non-coding workflows.
|
|
112
|
+
|
|
113
|
+
### Coding workflows
|
|
114
|
+
|
|
115
|
+
The coding side operates as a defense-in-depth system with three layers:
|
|
116
|
+
|
|
117
|
+
```mermaid
|
|
118
|
+
flowchart TD
|
|
119
|
+
A[Session Start] --> B[Inject Governance Protocol]
|
|
120
|
+
B --> C[Rules.md Loaded]
|
|
121
|
+
C --> D[Claude/You Write Code]
|
|
122
|
+
D --> E{PostToolUse Hook}
|
|
123
|
+
E -->|typecheck| F{Pass?}
|
|
124
|
+
E -->|lint| F
|
|
125
|
+
E -->|build| F
|
|
126
|
+
F -->|No| G[Blocked - Fix Required]
|
|
127
|
+
G --> D
|
|
128
|
+
F -->|Yes| H[Change Accepted]
|
|
129
|
+
H --> I[Quality Governance Pipeline]
|
|
130
|
+
I --> I1[Code Review]
|
|
131
|
+
I1 --> I2[Test Audit]
|
|
132
|
+
I2 --> I3[Test Fixes]
|
|
133
|
+
I3 --> I4[Code Fixes]
|
|
134
|
+
I4 --> J{More Work?}
|
|
135
|
+
J -->|Yes| D
|
|
136
|
+
J -->|No| K[Session Handoff]
|
|
137
|
+
K --> L[Session Stop]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Layer 1: Rules.** Injected into Claude's context at session start via the `SessionStart` hook. They define coding standards, testing requirements, and verification rules. Claude follows them because they're part of its active instructions, not because you asked nicely.
|
|
141
|
+
|
|
142
|
+
**Layer 2: Hooks.** Run after every `Write` or `Edit` operation. The `enforce-quality.sh` hook fires `typecheck`, `lint`, and `build` checks. If any fail, the change is flagged and Claude sees the errors. No silent failures.
|
|
143
|
+
|
|
144
|
+
**Layer 3: Pipelines.** Multi-agent workflows orchestrated by skills. A code review spawns 3-4 specialized agents (security, type safety, standards, synthesis). A test audit classifies every test file and checks for mock abuse. Each agent writes structured output to `logs/`, and only a summary returns to the main context.
|
|
145
|
+
|
|
146
|
+
### Non-coding workflows
|
|
147
|
+
|
|
148
|
+
The Bulwark also orchestrates research, brainstorming, and planning workflows that don't involve writing code. These run entirely through multi-agent pipelines.
|
|
149
|
+
|
|
150
|
+
**Research.** The `/the-bulwark:bulwark-research` skill spawns 5 parallel sub-agents, each researching a different viewpoint on your topic. After a short user interview, agents run concurrently and their findings merge into a single synthesis document. Useful for market research, competitor analysis, or deep dives on technical topics before you commit to a direction.
|
|
151
|
+
|
|
152
|
+
**Product Ideation.** The `/the-bulwark:product-ideation` skill spawns a full ideation team (6 agents) after a short user interview: market researcher, idea validator, competitive analyzer, segment analyzer, pattern documenter, and strategist. The pipeline produces a structured BUY/HOLD/SELL recommendation backed by evidence from each stage.
|
|
153
|
+
|
|
154
|
+
**Brainstorm & Plan Creation.** These two skills share a dual-mode orchestration pattern. You choose the mode based on how contested the topic is:
|
|
155
|
+
|
|
156
|
+
```mermaid
|
|
157
|
+
flowchart TD
|
|
158
|
+
A[User Interview] --> B{Mode Selection}
|
|
159
|
+
B -->|Sequential| C[Task Tool Pipeline]
|
|
160
|
+
C --> C1[Role 1] --> C2[Role 2] --> C3[Role 3] --> C4[Critic]
|
|
161
|
+
C4 --> E[Structured Output]
|
|
162
|
+
B -->|Agent Teams| D[Peer Debate]
|
|
163
|
+
D --> D1[All Roles + Critic Run Concurrently]
|
|
164
|
+
D1 --> D2[Real-time Collaboration & Challenge]
|
|
165
|
+
D2 --> E
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Sequential mode.** Each role writes its output, then the next role reads it and builds on it. Structured, predictable, lower token cost. Best for well-understood topics where roles won't disagree much.
|
|
169
|
+
|
|
170
|
+
**Agent Teams mode.** All roles run concurrently and debate in real-time. The Critic challenges assumptions as they form, not after they've hardened. Better convergence on contested topics, more token-intensive. Best for novel problems where you want genuine adversarial pressure on every claim.
|
|
171
|
+
|
|
172
|
+
## Conventions
|
|
173
|
+
|
|
174
|
+
The Bulwark enforces a specific set of conventions through `Rules.md`. When you run `/the-bulwark:init`, it installs these rules into your project at `.claude/rules/rules.md` where Claude Code automatically loads them every session. It also creates a `CLAUDE.md` with project-specific instructions (backing up any existing one first), and lets you choose scope — project-level (checked into the repo, shared with your team) or user-level (local to your machine, not committed).
|
|
175
|
+
|
|
176
|
+
The rules cover four areas:
|
|
177
|
+
|
|
178
|
+
**Coding Standards (CS1-CS4).** Single responsibility, no magic, fail fast, clean code. Every function does one thing. No hidden dependencies. Validate inputs at boundaries. Delete dead code instead of commenting it out.
|
|
179
|
+
|
|
180
|
+
**Testing Rules (T1-T4).** Never mock the system under test. Verify observable output, not function calls. Integration tests use real systems. Write tests with implementation, not after. These four rules alone eliminate the most common failure modes in AI-generated test suites.
|
|
181
|
+
|
|
182
|
+
**Verification Rules (V1-V4).** Never declare a fix complete without running it. Use `just` for all execution. Check logs for full output before attempting fixes. Verify compilation after every change.
|
|
183
|
+
|
|
184
|
+
**Issue Debugging (ID1-ID3).** Understand the root cause before fixing. Rank complexity. Run the right level of tests. Document the debugging journey.
|
|
185
|
+
|
|
186
|
+
Rules are not advisory. They're injected as binding instructions. Claude treats them as contract obligations, not suggestions.
|
|
187
|
+
|
|
188
|
+
## Hooks
|
|
189
|
+
|
|
190
|
+
The Bulwark installs four hooks that run automatically. No manual invocation needed.
|
|
191
|
+
|
|
192
|
+
| Hook | Event | Trigger | Timeout | What It Does |
|
|
193
|
+
|------|-------|---------|---------|--------------|
|
|
194
|
+
| `enforce-quality.sh` | PostToolUse | Every `Write` or `Edit` on code files | 60s | Runs `just typecheck`, `just lint`, `just build`. Flags failures to Claude with full error output. Skips non-code files (`tmp/`, `logs/`, `.claude/`, `docs/`). |
|
|
195
|
+
| `inject-protocol.sh` | SessionStart | Every new session | 5s | Injects the governance protocol into Claude's context. Loads Rules.md, activates quality enforcement, displays the activation banner. |
|
|
196
|
+
| `cleanup-stale.sh` | SessionStart | Every new session | 30s | Deletes files older than 10 days from `logs/` and `tmp/`. Preserves `.gitkeep` files. Keeps your repo from accumulating stale pipeline output. |
|
|
197
|
+
| `track-pipeline-start.sh` | SubagentStart | Any sub-agent spawned | 30s | Logs pipeline invocation metadata (agent name, timestamp, parent context) for observability. |
|
|
198
|
+
| `track-pipeline-stop.sh` | SubagentStop | Any sub-agent exits | 30s | Logs pipeline completion metadata (agent name, duration, exit status) for observability. |
|
|
199
|
+
|
|
200
|
+
All hooks use `${CLAUDE_PLUGIN_ROOT}` for path resolution, so they work regardless of where the plugin is installed.
|
|
201
|
+
|
|
202
|
+
## Skill registry
|
|
203
|
+
|
|
204
|
+
The Bulwark ships 28 skills. Each one is invoked with `/the-bulwark:{skill-name}` or triggered automatically by hooks and pipelines. Skills are grouped by what they do.
|
|
205
|
+
|
|
206
|
+
### Product & strategy
|
|
207
|
+
|
|
208
|
+
Skills for ideation, research, and planning. These don't write code. They run multi-agent pipelines that produce structured documents.
|
|
209
|
+
|
|
210
|
+
| Skill | What it does | Sub-agents |
|
|
211
|
+
|-------|-------------|------------|
|
|
212
|
+
| [product-ideation](docs/skills/product-ideation.md) | Evaluates product ideas through a 6-agent pipeline. Produces a BUY/HOLD/SELL recommendation with market analysis, competitive intelligence, and segment targeting. | [market-researcher](docs/agents/product-ideation-market-researcher.md), [idea-validator](docs/agents/product-ideation-idea-validator.md), [competitive-analyzer](docs/agents/product-ideation-competitive-analyzer.md), [segment-analyzer](docs/agents/product-ideation-segment-analyzer.md), [pattern-documenter](docs/agents/product-ideation-pattern-documenter.md), [strategist](docs/agents/product-ideation-strategist.md) |
|
|
213
|
+
| [bulwark-research](docs/skills/bulwark-research.md) | Spawns 5 parallel sub-agents to research different viewpoints on a topic. Merges findings into a synthesis document. | 5 parallel Sonnet agents (dynamically created) |
|
|
214
|
+
| [bulwark-brainstorm](docs/skills/bulwark-brainstorm.md) | Dual-mode brainstorming. `--scoped` runs 5 roles sequentially via Task tool. `--exploratory` runs 4 roles concurrently via Agent Teams with real-time peer debate. | Sequential: 5 role agents. Agent Teams: 4 concurrent agents + Critic. |
|
|
215
|
+
| [plan-creation](docs/skills/plan-creation.md) | Creates implementation plans with a 4-role scrum team. Produces phases, workpackages, tasks, and delivery schedules. Dual-mode (Task tool or Agent Teams). | [PO](docs/agents/plan-creation-po.md), [Architect](docs/agents/plan-creation-architect.md), [Eng Lead](docs/agents/plan-creation-eng-lead.md), [QA/Critic](docs/agents/plan-creation-qa-critic.md) |
|
|
216
|
+
|
|
217
|
+
### Code quality
|
|
218
|
+
|
|
219
|
+
Skills that review, test, and fix code. These are the enforcement layer that runs after you write code.
|
|
220
|
+
|
|
221
|
+
| Skill | What it does | Sub-agents |
|
|
222
|
+
|-------|-------------|------------|
|
|
223
|
+
| [code-review](docs/skills/code-review.md) | Three-phase code review: static tools, LLM judgment across 3-4 aspects (security, type safety, standards), and diagnostic log. | 3-4 Sonnet agents (aspect-specific) |
|
|
224
|
+
| [test-audit](docs/skills/test-audit.md) | Audits test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Triggers automatic rewrites when quality gates fail. | Haiku (classification), Sonnet (mock detection, synthesis) |
|
|
225
|
+
| [fix-bug](docs/skills/fix-bug.md) | 5-stage fix validation pipeline: analyze, implement, write tests, audit tests, validate fix. | [issue-analyzer](docs/agents/bulwark-issue-analyzer.md), [implementer](docs/agents/bulwark-implementer.md), [fix-validator](docs/agents/bulwark-fix-validator.md) |
|
|
226
|
+
| [issue-debugging](docs/skills/issue-debugging.md) | Systematic debugging methodology with root cause analysis, impact mapping, tiered validation plans, and confidence assessment. | [issue-analyzer](docs/agents/bulwark-issue-analyzer.md), [fix-validator](docs/agents/bulwark-fix-validator.md) |
|
|
227
|
+
| [mock-detection](docs/skills/mock-detection.md) | Deep mock appropriateness analysis. Determines whether mocks in a test file are legitimate or T1-T4 violations. | Sonnet agent (analysis) |
|
|
228
|
+
| [test-classification](docs/skills/test-classification.md) | Classifies test files by type (unit, integration, E2E) and identifies which files need deeper mock analysis. | Haiku agents (batch classification) |
|
|
229
|
+
| [test-fixture-creation](docs/skills/test-fixture-creation.md) | Creates unbiased test fixtures using a Sonnet agent that can't read the implementation. Fixtures integrate with project infrastructure and hook automation. | Sonnet agent (fixture generation) |
|
|
230
|
+
| [bulwark-verify](docs/skills/bulwark-verify.md) | Generates runnable verification scripts for components by orchestrating assertion-patterns and component-patterns. | Sonnet agent (script generation) |
|
|
231
|
+
| [assertion-patterns](docs/skills/assertion-patterns.md) | Reference for transforming T1-T4 violating tests into real output verification. Loaded by other skills as context. | None (reference skill) |
|
|
232
|
+
| [component-patterns](docs/skills/component-patterns.md) | Per-component-type verification approaches. Loaded by bulwark-verify as context for generating verification scripts. | None (reference skill) |
|
|
233
|
+
| [bug-magnet-data](docs/skills/bug-magnet-data.md) | Curated edge case test data for boundary testing. Provides pre-organized data by type (dates, strings, numbers, Unicode, etc.) for test generation. | None (reference skill) |
|
|
234
|
+
|
|
235
|
+
### Project setup & tooling
|
|
236
|
+
|
|
237
|
+
Skills for initializing projects, configuring tooling, and managing sessions.
|
|
238
|
+
|
|
239
|
+
| Skill | What it does | Sub-agents |
|
|
240
|
+
|-------|-------------|------------|
|
|
241
|
+
| [init](docs/skills/init.md) | Guided project initialization. Installs Rules.md, creates CLAUDE.md, offers LSP setup, Justfile scaffolding, and statusline configuration. Auto-detects brownfield projects. | None (orchestrates other skills) |
|
|
242
|
+
| [bulwark-scaffold](docs/skills/bulwark-scaffold.md) | Generates Justfile with build/typecheck/lint recipes, creates logs directory, and optionally configures hooks. | None |
|
|
243
|
+
| [setup-lsp](docs/skills/setup-lsp.md) | Configures Language Server Protocol integration. Detects project languages, offers to install language servers, verifies post-restart initialization. | None |
|
|
244
|
+
| [bulwark-statusline](docs/skills/bulwark-statusline.md) | Configures the Claude Code status line to show token usage and cost in real-time. Supports preset switching and customization. | [statusline-setup](docs/agents/statusline-setup.md) |
|
|
245
|
+
| [session-handoff](docs/skills/session-handoff.md) | Creates session handoff documents for context transfer between sessions. Ensures proper YAML headers, LF line endings, and complete documentation of progress and decisions. | None |
|
|
246
|
+
| [governance-protocol](docs/skills/governance-protocol.md) | The governance protocol injected at session start via the SessionStart hook. Not invoked directly. | None |
|
|
247
|
+
|
|
248
|
+
### Meta skills
|
|
249
|
+
|
|
250
|
+
Skills for building more skills, orchestrating pipelines, and improving existing workflows.
|
|
251
|
+
|
|
252
|
+
| Skill | What it does | Sub-agents |
|
|
253
|
+
|-------|-------------|------------|
|
|
254
|
+
| [create-skill](docs/skills/create-skill.md) | Generates Claude Code skills from requirements. Runs an adaptive interview, classifies complexity, and produces SKILL.md with references and templates. | Sonnet agent (validation) |
|
|
255
|
+
| [create-subagent](docs/skills/create-subagent.md) | Generates single-purpose sub-agents for use via the Task tool. Produces agent definition with diagnostics and permissions setup. | Sonnet agent (validation) |
|
|
256
|
+
| [continuous-feedback](docs/skills/continuous-feedback.md) | Parses past session learnings and memory files to identify improvement targets. Proposes concrete skill/agent modifications with copy-paste ready patches. | Sonnet agents (analysis, proposal generation) |
|
|
257
|
+
| [anthropic-validator](docs/skills/anthropic-validator.md) | Validates Claude Code assets (skills, hooks, agents, plugins) against official Anthropic standards. Fetches latest docs dynamically. | [standards-reviewer](docs/agents/bulwark-standards-reviewer.md) |
|
|
258
|
+
| [pipeline-templates](docs/skills/pipeline-templates.md) | Pre-defined workflow templates for multi-agent orchestration. Provides code review, fix validation, test audit, new feature, and research pipelines. | None (reference skill) |
|
|
259
|
+
| [subagent-prompting](docs/skills/subagent-prompting.md) | Template for structured sub-agent invocation using 4-part prompting (GOAL/CONSTRAINTS/CONTEXT/OUTPUT) and F# pipeline notation. | None (reference skill) |
|
|
260
|
+
| [subagent-output-templating](docs/skills/subagent-output-templating.md) | Template for structured sub-agent output including YAML log format and task completion reports. | None (reference skill) |
|
|
261
|
+
|
|
262
|
+
## Agent registry
|
|
263
|
+
|
|
264
|
+
Agents are single-purpose sub-agents spawned by skills via the Task tool. You don't invoke them directly. Each agent has a defined model, reads input from a previous pipeline stage, and writes structured output to `logs/`.
|
|
265
|
+
|
|
266
|
+
### Fix validation agents
|
|
267
|
+
|
|
268
|
+
| Agent | Model | Purpose | Invoked by |
|
|
269
|
+
|-------|-------|---------|------------|
|
|
270
|
+
| [bulwark-issue-analyzer](docs/agents/bulwark-issue-analyzer.md) | Sonnet | Root cause analysis, impact mapping, debug report with tiered validation plan | [fix-bug](docs/skills/fix-bug.md), [issue-debugging](docs/skills/issue-debugging.md) |
|
|
271
|
+
| [bulwark-implementer](docs/agents/bulwark-implementer.md) | Opus | Implements fixes and features. Runs implementer-quality.sh after every write. | [fix-bug](docs/skills/fix-bug.md) |
|
|
272
|
+
| [bulwark-fix-validator](docs/agents/bulwark-fix-validator.md) | Sonnet | Executes tiered test plan from the issue analyzer's debug report. Assesses fix confidence. | [fix-bug](docs/skills/fix-bug.md), [issue-debugging](docs/skills/issue-debugging.md) |
|
|
273
|
+
| [bulwark-standards-reviewer](docs/agents/bulwark-standards-reviewer.md) | Sonnet | Validates Claude Code assets against official Anthropic standards. Produces severity-rated findings. | [anthropic-validator](docs/skills/anthropic-validator.md) |
|
|
274
|
+
|
|
275
|
+
### Plan creation agents
|
|
276
|
+
|
|
277
|
+
| Agent | Model | Purpose | Invoked by |
|
|
278
|
+
|-------|-------|---------|------------|
|
|
279
|
+
| [plan-creation-po](docs/agents/plan-creation-po.md) | Opus | Product Owner. Explores codebase, produces requirements analysis with scope, acceptance criteria, and user value. | [plan-creation](docs/skills/plan-creation.md) |
|
|
280
|
+
| [plan-creation-architect](docs/agents/plan-creation-architect.md) | Opus | Technical Architect. Analyzes system design, component decomposition, integration points, and technical trade-offs. | [plan-creation](docs/skills/plan-creation.md) |
|
|
281
|
+
| [plan-creation-eng-lead](docs/agents/plan-creation-eng-lead.md) | Sonnet | Engineering & Delivery Lead. Produces WBS, effort estimates, dependency graphs, milestones, and risk registers. | [plan-creation](docs/skills/plan-creation.md) |
|
|
282
|
+
| [plan-creation-qa-critic](docs/agents/plan-creation-qa-critic.md) | Sonnet | QA / Critic. Adversarially challenges assumptions, stress-tests estimates, issues APPROVE/MODIFY/REJECT verdict. | [plan-creation](docs/skills/plan-creation.md) |
|
|
283
|
+
|
|
284
|
+
### Product ideation agents
|
|
285
|
+
|
|
286
|
+
| Agent | Model | Purpose | Invoked by |
|
|
287
|
+
|-------|-------|---------|------------|
|
|
288
|
+
| [product-ideation-market-researcher](docs/agents/product-ideation-market-researcher.md) | Sonnet | Researches market size, growth trends, key players, regulatory landscape. Produces TAM/SAM/SOM estimates. | [product-ideation](docs/skills/product-ideation.md) |
|
|
289
|
+
| [product-ideation-idea-validator](docs/agents/product-ideation-idea-validator.md) | Sonnet | Assesses feasibility, timing, uniqueness, problem-solution fit. Produces PASS/CONDITIONAL/FAIL verdict. | [product-ideation](docs/skills/product-ideation.md) |
|
|
290
|
+
| [product-ideation-competitive-analyzer](docs/agents/product-ideation-competitive-analyzer.md) | Sonnet | Profiles competitors, analyzes positioning and pricing, identifies market gaps using Porter's Five Forces. | [product-ideation](docs/skills/product-ideation.md) |
|
|
291
|
+
| [product-ideation-segment-analyzer](docs/agents/product-ideation-segment-analyzer.md) | Sonnet | Identifies target user segments, builds personas using Jobs-to-be-Done, estimates willingness to pay. | [product-ideation](docs/skills/product-ideation.md) |
|
|
292
|
+
| [product-ideation-pattern-documenter](docs/agents/product-ideation-pattern-documenter.md) | Sonnet | Documents success/failure patterns, competitor trajectories, and opportunity gaps from competitive data. | [product-ideation](docs/skills/product-ideation.md) |
|
|
293
|
+
| [product-ideation-strategist](docs/agents/product-ideation-strategist.md) | Sonnet | Final synthesis. Produces BUY/HOLD/SELL recommendation with confidence level and actionable next steps. | [product-ideation](docs/skills/product-ideation.md) |
|
|
294
|
+
|
|
295
|
+
### Utility agents
|
|
296
|
+
|
|
297
|
+
| Agent | Model | Purpose | Invoked by |
|
|
298
|
+
|-------|-------|---------|------------|
|
|
299
|
+
| [statusline-setup](docs/agents/statusline-setup.md) | Haiku | Handles settings.json updates and config file placement for statusline configuration. | [bulwark-statusline](docs/skills/bulwark-statusline.md) |
|
|
300
|
+
|
|
301
|
+
## FAQ and troubleshooting
|
|
302
|
+
|
|
303
|
+
### Plugin clone fails with "Permission denied (publickey)"
|
|
304
|
+
|
|
305
|
+
If you see this error when installing from the marketplace:
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
git@github.com: Permission denied (publickey).
|
|
309
|
+
fatal: Could not read from remote repository.
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Your git is defaulting to SSH for GitHub, but you don't have SSH keys configured. Fix by telling git to use HTTPS:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Then retry the install. This applies globally and redirects all GitHub SSH URLs to HTTPS.
|
|
319
|
+
|
|
320
|
+
### Hooks aren't firing after install
|
|
321
|
+
|
|
322
|
+
Restart your Claude Code session. Hooks only load at session start. If they still don't fire, check that the plugin is installed:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
claude /plugin list
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
If `the-bulwark` appears in the list but hooks still don't run, check `hooks/hooks.json` exists in the plugin directory. The `${CLAUDE_PLUGIN_ROOT}` variable must resolve to the plugin's install location.
|
|
329
|
+
|
|
330
|
+
### Quality gate keeps failing on non-code files
|
|
331
|
+
|
|
332
|
+
The `enforce-quality.sh` hook skips files in `tmp/`, `logs/`, `.claude/`, `docs/`, and `node_modules/`. If you're editing a file outside these directories that isn't code (like a config file), the hook may still trigger. This is by design. If the failure is a false positive, check that your `Justfile` recipes handle the file type correctly.
|
|
333
|
+
|
|
334
|
+
### Multi-agent pipelines time out or get interrupted
|
|
335
|
+
|
|
336
|
+
This usually means you're hitting rate limits on your Claude plan. The product-ideation pipeline spawns 6 agents sequentially, and plan-creation can spawn 4. Each agent consumes tokens independently. Max and Enterprise plans handle this without issues. Pro Plus will work for single-agent skills but may hit limits on pipelines with 3+ agents.
|
|
337
|
+
|
|
338
|
+
### `just` command not found
|
|
339
|
+
|
|
340
|
+
The `/the-bulwark:init` skill offers to install `just` for you during setup. If you skipped that step, install it manually:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Or via your package manager: `brew install just` (macOS), `cargo install just` (Rust), `apt install just` (Debian/Ubuntu).
|
|
347
|
+
|
|
348
|
+
### Rules.md conflicts with my existing project rules
|
|
349
|
+
|
|
350
|
+
The Bulwark installs its rules at `.claude/rules/rules.md`. If you already have rules in `.claude/rules/`, they won't be overwritten. The Bulwark's rules and your project rules both load at session start and coexist. If there's a conflict, your project-specific CLAUDE.md instructions take precedence since they load after the rules.
|
|
351
|
+
|
|
352
|
+
### Can I use this with other Claude Code plugins?
|
|
353
|
+
|
|
354
|
+
Yes. The Bulwark doesn't interfere with other plugins. Its hooks use `${CLAUDE_PLUGIN_ROOT}` for path resolution, so there's no collision. The only potential issue is if another plugin also installs PostToolUse hooks on Write/Edit, in which case both hooks run (Claude Code runs all matching hooks, not just the first one).
|
|
355
|
+
|
|
356
|
+
### How do I update the plugin?
|
|
357
|
+
|
|
358
|
+
Use the plugin update command:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
claude plugin update the-bulwark@qball-inc
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
You can also enable auto-updates per marketplace. Open `/plugin`, go to the Marketplaces tab, select the QBall-Inc marketplace, and toggle auto-update on. Note that auto-update is disabled by default for third-party marketplaces.
|
|
365
|
+
|
|
366
|
+
If you installed via npm, the same update command works. Claude Code resolves the source from the installed plugin metadata.
|
|
367
|
+
|
|
368
|
+
Your project's Rules.md and CLAUDE.md are not affected by updates since they live in your project repo, not in the plugin directory.
|
|
369
|
+
|
|
370
|
+
### The statusline shows token usage but not cost
|
|
371
|
+
|
|
372
|
+
Cost tracking depends on your Claude Code version and plan. If cost data isn't available from the API, the statusline falls back to showing token counts only. Run `/the-bulwark:bulwark-statusline` to reconfigure or switch presets.
|
|
373
|
+
|
|
374
|
+
### I want to disable a specific hook temporarily
|
|
375
|
+
|
|
376
|
+
You can't disable individual plugin hooks without modifying `hooks/hooks.json` in the plugin directory. But you can work around it by adding the file path to the skip list in `enforce-quality.sh`, or by working in a directory that the hook already skips (`tmp/`, `logs/`, etc.).
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Planned enhancements
|
|
381
|
+
|
|
382
|
+
These are on the roadmap. No timeline commitments, but they represent the direction The Bulwark is heading.
|
|
383
|
+
|
|
384
|
+
**Evaluation framework.** Skills and agents are the new code layer in agentic development. They need the same rigor as code: versioned, tested, measured. We're building two new skills — `create-eval` and `run-eval` — that generate and execute evaluations for any Claude Code asset. Define test prompts, expected outputs, and grading criteria. Run them across skill versions to catch regressions. Measure conversational invocation success, checklist compliance, and output quality with structured grading reports.
|
|
385
|
+
|
|
386
|
+
**Asset baselines.** Once the eval skills exist, we'll baseline all 28 skills and 15 agents with versioned evaluations. Every asset gets a `version` field in its frontmatter and a set of evals that serve as regression references. Future changes get measured against these baselines automatically.
|
|
387
|
+
|
|
388
|
+
**Enterprise traceability.** Enhanced logging with version stamps (skill version, model, rules hash) in every sub-agent log header. Run manifests that tie together all artifacts from a pipeline execution into a single auditable record. Decision lineage: trace any output back to which model, skill version, and rules produced it.
|
|
389
|
+
|
|
390
|
+
**Security pattern updates.** A helper skill that pulls the latest vulnerability patterns and edge cases into the test-audit pipeline. Keeps your security coverage current without manual curation.
|
|
391
|
+
|
|
392
|
+
**Framework-specific Justfiles.** Auto-detect your project's framework (Next.js, Django, FastAPI, Actix, etc.) and generate tailored `just` recipes with the right build, test, and lint commands out of the box.
|
|
393
|
+
|
|
394
|
+
**Agent memory.** Persistent memory for sub-agents across invocations. Agents remember patterns from previous runs — common failure modes, project-specific conventions, recurring issues — and apply that context automatically.
|
|
395
|
+
|
|
396
|
+
**Smarter pipeline routing.** Better orchestration for review-then-fix workflows. When a code review finds issues, automatically route to fix validation without manual intervention. Tighter feedback loops between review, fix, and retest stages.
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## License
|
|
401
|
+
|
|
402
|
+
[MIT](LICENSE)
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
### If you find this useful, please give it a star. It helps others discover the project.
|
|
407
|
+
|
|
408
|
+
[](https://github.com/QBall-Inc/the-bulwark)
|
package/hooks/hooks.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qball-inc/the-bulwark",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Full-lifecycle SDLC guardrailing framework for Claude Code — from product ideation and planning through implementation, code review, and test validation. Enterprise-grade skills and agents for AI-human peer collaboration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ashay Kubal <https://ashaykubal.com>",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# enforce-quality.sh - Quality gate +
|
|
2
|
+
# enforce-quality.sh - Quality gate + changed-files accumulator
|
|
3
3
|
#
|
|
4
4
|
# Called by PostToolUse hooks on Write|Edit operations.
|
|
5
5
|
#
|
|
@@ -7,12 +7,16 @@
|
|
|
7
7
|
# - Runs just typecheck, lint, build
|
|
8
8
|
# - Exit 2 on failure (blocks tool call)
|
|
9
9
|
#
|
|
10
|
-
# Phase 2:
|
|
11
|
-
# -
|
|
12
|
-
# -
|
|
10
|
+
# Phase 2: Accumulator write (code + script files only)
|
|
11
|
+
# - Appends file path to tmp/bulwark-changed-files.json
|
|
12
|
+
# - Excludes docs, config, infra paths via extension + prefix filter
|
|
13
|
+
# - Dedup on path
|
|
14
|
+
# - Stop hook (suggest-pipeline-stop.sh) reads accumulator and emits
|
|
15
|
+
# exactly ONE pipeline-suggestion block per turn — replacing the legacy
|
|
16
|
+
# per-edit decision:block anti-pattern (hook storm / silent crash).
|
|
13
17
|
#
|
|
14
18
|
# Exit codes:
|
|
15
|
-
# 0 = All checks passed,
|
|
19
|
+
# 0 = All checks passed, accumulator updated
|
|
16
20
|
# 2 = Quality gate failed (block)
|
|
17
21
|
#
|
|
18
22
|
# Usage: Called by hooks, not directly by users
|
|
@@ -22,14 +26,11 @@ set -euo pipefail
|
|
|
22
26
|
# Configuration
|
|
23
27
|
MAX_OUTPUT_LINES=100
|
|
24
28
|
|
|
25
|
-
# Color codes (if terminal supports)
|
|
26
|
-
RED='\033[0;31m'
|
|
27
|
-
GREEN='\033[0;32m'
|
|
29
|
+
# Color codes (if terminal supports) — used for warning banners only
|
|
28
30
|
YELLOW='\033[0;33m'
|
|
29
31
|
NC='\033[0m' # No Color
|
|
30
32
|
|
|
31
33
|
# Get directories
|
|
32
|
-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
33
34
|
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-.}"
|
|
34
35
|
LOGS_DIR="${PROJECT_DIR}/logs"
|
|
35
36
|
HOOKS_LOG="${LOGS_DIR}/hooks.log"
|
|
@@ -48,10 +49,18 @@ echo "[${TIMESTAMP}] PostToolUse: enforce-quality.sh triggered for ${FILE_PATH_F
|
|
|
48
49
|
# Extract file path from input
|
|
49
50
|
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // ""')
|
|
50
51
|
|
|
51
|
-
#
|
|
52
|
+
# Normalize absolute path to repo-relative (if under PROJECT_DIR)
|
|
53
|
+
REL_PATH="$FILE_PATH"
|
|
54
|
+
if [ -n "$FILE_PATH" ] && [ "${PROJECT_DIR}" != "." ] && [[ "$REL_PATH" == "$PROJECT_DIR/"* ]]; then
|
|
55
|
+
REL_PATH="${REL_PATH#"$PROJECT_DIR/"}"
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# Skip infrastructure directories (no quality checks or pipeline suggestions).
|
|
59
|
+
# Matches against REPO-RELATIVE path — absolute-path glob matching was a bug:
|
|
60
|
+
# any project under a path containing /tmp/, /logs/, etc. was ignored entirely.
|
|
52
61
|
# DEF-005: Prevents infinite loops when writing to logs/
|
|
53
|
-
case "$
|
|
54
|
-
|
|
62
|
+
case "$REL_PATH" in
|
|
63
|
+
logs/*|tmp/*|.claude/*|node_modules/*|dist/*|build/*|.git/*)
|
|
55
64
|
exit 0
|
|
56
65
|
;;
|
|
57
66
|
esac
|
|
@@ -145,22 +154,62 @@ if is_code_file "$FILE_PATH"; then
|
|
|
145
154
|
}
|
|
146
155
|
fi
|
|
147
156
|
|
|
148
|
-
# Export quality results for suggest-pipeline.sh
|
|
149
|
-
export QUALITY_CHECKS_PASSED="true"
|
|
150
157
|
fi
|
|
151
158
|
fi
|
|
152
159
|
fi
|
|
153
160
|
|
|
154
161
|
# ============================================================
|
|
155
|
-
# PHASE 2:
|
|
162
|
+
# PHASE 2: Accumulator Write (code + script files only)
|
|
156
163
|
# ============================================================
|
|
164
|
+
#
|
|
165
|
+
# Legacy Phase 2 chained to suggest-pipeline.sh, which emitted one
|
|
166
|
+
# decision:block per edit — cascading into N interrupts on multi-edit turns.
|
|
167
|
+
# Replaced by: append qualifying file path to accumulator; Stop hook
|
|
168
|
+
# (suggest-pipeline-stop.sh) emits exactly one block at turn end.
|
|
169
|
+
|
|
170
|
+
# Skip accumulator write if no file path (defensive)
|
|
171
|
+
if [ -z "$FILE_PATH" ]; then
|
|
172
|
+
exit 0
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# --- Exclusion filter: extensions ---
|
|
176
|
+
# Docs, config, data files do not warrant pipeline orchestration.
|
|
177
|
+
# Prefix exclusions (logs/, tmp/, .claude/, node_modules/, dist/, build/, .git/)
|
|
178
|
+
# already exited at the top-of-file skip. REL_PATH is also pre-computed there.
|
|
179
|
+
FILENAME=$(basename "$FILE_PATH")
|
|
180
|
+
EXTENSION="${FILENAME##*.}"
|
|
181
|
+
EXTENSION_LOWER=$(echo "$EXTENSION" | tr '[:upper:]' '[:lower:]')
|
|
182
|
+
|
|
183
|
+
case "$EXTENSION_LOWER" in
|
|
184
|
+
md|markdown|json|jsonc|yaml|yml|xml|csv|tsv|txt|docx|xlsx|pdf|html|htm)
|
|
185
|
+
exit 0
|
|
186
|
+
;;
|
|
187
|
+
esac
|
|
188
|
+
|
|
189
|
+
# --- Accumulator: ensure directory, validate, append with dedup ---
|
|
190
|
+
ACCUMULATOR_DIR="${PROJECT_DIR}/tmp"
|
|
191
|
+
ACCUMULATOR="${ACCUMULATOR_DIR}/bulwark-changed-files.json"
|
|
192
|
+
mkdir -p "$ACCUMULATOR_DIR"
|
|
157
193
|
|
|
158
|
-
|
|
194
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // "unknown"')
|
|
195
|
+
ACC_TIMESTAMP=$(date -Iseconds)
|
|
196
|
+
|
|
197
|
+
# Recover from corrupt accumulator
|
|
198
|
+
if [ -f "$ACCUMULATOR" ] && ! jq -e '.' "$ACCUMULATOR" >/dev/null 2>&1; then
|
|
199
|
+
rm -f "$ACCUMULATOR"
|
|
200
|
+
fi
|
|
159
201
|
|
|
160
|
-
if [ -
|
|
161
|
-
|
|
162
|
-
|
|
202
|
+
if [ ! -f "$ACCUMULATOR" ]; then
|
|
203
|
+
jq -n --arg p "$REL_PATH" --arg t "$TOOL_NAME" --arg ts "$ACC_TIMESTAMP" \
|
|
204
|
+
'{version: "1.0", files: [{path: $p, tool: $t, time: $ts}]}' > "$ACCUMULATOR"
|
|
163
205
|
else
|
|
164
|
-
#
|
|
165
|
-
|
|
206
|
+
# Dedup: append only if path not already present
|
|
207
|
+
EXISTING=$(jq -r --arg p "$REL_PATH" '.files[] | select(.path == $p) | .path' "$ACCUMULATOR" 2>/dev/null || echo "")
|
|
208
|
+
if [ -z "$EXISTING" ]; then
|
|
209
|
+
jq --arg p "$REL_PATH" --arg t "$TOOL_NAME" --arg ts "$ACC_TIMESTAMP" \
|
|
210
|
+
'.files += [{path: $p, tool: $t, time: $ts}]' "$ACCUMULATOR" > "${ACCUMULATOR}.tmp" \
|
|
211
|
+
&& mv "${ACCUMULATOR}.tmp" "$ACCUMULATOR"
|
|
212
|
+
fi
|
|
166
213
|
fi
|
|
214
|
+
|
|
215
|
+
exit 0
|