@chief-clancy/brief 0.1.0 → 0.1.1
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/README.md +74 -0
- package/package.json +1 -1
- package/src/workflows/brief.md +58 -35
- package/src/workflows/workflows.test.ts +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @chief-clancy/brief
|
|
2
|
+
|
|
3
|
+
**Strategic brief generator for Claude Code.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@chief-clancy/brief) [](../../LICENSE)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @chief-clancy/brief
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Turn feature ideas into structured strategic briefs with vertical-slice ticket decomposition. Works standalone — no board credentials, no pipeline, no config required.
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
The `/clancy:brief` slash command researches your codebase, grills you (or itself) on requirements, and produces a brief document with:
|
|
16
|
+
|
|
17
|
+
- Problem statement and goals
|
|
18
|
+
- Discovery Q&A from the grill phase
|
|
19
|
+
- User stories
|
|
20
|
+
- Technical considerations
|
|
21
|
+
- Ticket decomposition table (vertical slices, sized, with dependencies)
|
|
22
|
+
- Open questions and risks
|
|
23
|
+
|
|
24
|
+
## How it works
|
|
25
|
+
|
|
26
|
+
1. **Install:** `npx @chief-clancy/brief` — choose global or local
|
|
27
|
+
2. **Run:** `/clancy:brief "Add dark mode support"` — inline text
|
|
28
|
+
3. **Or from a file:** `/clancy:brief --from docs/rfc.md`
|
|
29
|
+
4. **Or from a board ticket:** `/clancy:brief #42` (requires board credentials)
|
|
30
|
+
|
|
31
|
+
Briefs are saved to `.clancy/briefs/` in your project.
|
|
32
|
+
|
|
33
|
+
## Input modes
|
|
34
|
+
|
|
35
|
+
| Mode | Example | Board needed? |
|
|
36
|
+
| ------------ | --------------------------------------------- | ------------- |
|
|
37
|
+
| Inline text | `/clancy:brief "Add dark mode"` | No |
|
|
38
|
+
| From file | `/clancy:brief --from docs/rfc.md` | No |
|
|
39
|
+
| Board ticket | `/clancy:brief #42`, `/clancy:brief PROJ-123` | Yes |
|
|
40
|
+
| Batch | `/clancy:brief 3` | Yes |
|
|
41
|
+
| Interactive | `/clancy:brief` | No |
|
|
42
|
+
|
|
43
|
+
## Flags
|
|
44
|
+
|
|
45
|
+
| Flag | Description |
|
|
46
|
+
| --------------- | ------------------------------------- |
|
|
47
|
+
| `--afk` | AI-grill instead of human interview |
|
|
48
|
+
| `--fresh` | Discard existing brief and start over |
|
|
49
|
+
| `--research` | Include web research in analysis |
|
|
50
|
+
| `--from <path>` | Brief from a local file |
|
|
51
|
+
| `--epic <KEY>` | Set parent for ticket creation |
|
|
52
|
+
| `--list` | Show inventory of existing briefs |
|
|
53
|
+
|
|
54
|
+
## Standalone vs full pipeline
|
|
55
|
+
|
|
56
|
+
This package works on its own for inline text and file-based briefs. For board integration, ticket creation, and the full development pipeline, install the complete Clancy package:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx chief-clancy
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Part of the Clancy monorepo
|
|
63
|
+
|
|
64
|
+
- [`chief-clancy`](https://www.npmjs.com/package/chief-clancy) — full pipeline (install, configure, implement, autopilot)
|
|
65
|
+
- [`@chief-clancy/terminal`](https://www.npmjs.com/package/@chief-clancy/terminal) — installer, slash commands, hooks, runners
|
|
66
|
+
- [`@chief-clancy/core`](https://www.npmjs.com/package/@chief-clancy/core) — board integrations, pipeline phases, schemas
|
|
67
|
+
|
|
68
|
+
## Credits
|
|
69
|
+
|
|
70
|
+
Built on the [Ralph technique](https://ghuntley.com/ralph/) by Geoffrey Huntley. See [CREDITS.md](https://github.com/Pushedskydiver/chief-clancy/blob/main/CREDITS.md).
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT — see [LICENSE](https://github.com/Pushedskydiver/chief-clancy/blob/main/LICENSE).
|
package/package.json
CHANGED
package/src/workflows/brief.md
CHANGED
|
@@ -2,47 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
Research an idea, interrogate it thoroughly, and generate a structured strategic brief with vertical-slice ticket decomposition. Briefs are saved locally and optionally posted as comments on the source ticket. Does not create tickets —
|
|
5
|
+
Research an idea, interrogate it thoroughly, and generate a structured strategic brief with vertical-slice ticket decomposition. Briefs are saved locally and optionally posted as comments on the source ticket. Does not create tickets — in **terminal mode**, use `/clancy:approve-brief` for that. In **standalone mode**, install the full pipeline (`npx chief-clancy`) to create tickets from briefs.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Step 1 — Preflight checks
|
|
10
10
|
|
|
11
|
-
1.
|
|
11
|
+
### 1. Detect installation context
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
.clancy/ not found. Run /clancy:init to set up Clancy first.
|
|
15
|
-
```
|
|
13
|
+
Check for `.clancy/.env`:
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
- **Present** → **terminal mode**. Full Clancy installation detected.
|
|
16
|
+
- **Absent** → **standalone mode**. Running from `@chief-clancy/brief` only.
|
|
18
17
|
|
|
19
|
-
2.
|
|
18
|
+
### 2. Terminal-mode preflight (skip in standalone mode)
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
If `.clancy/.env` is present:
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
The Strategist role is not enabled. Add "strategist" to CLANCY_ROLES in .clancy/.env or run /clancy:settings.
|
|
25
|
-
```
|
|
22
|
+
a. Source `.clancy/.env` and check board credentials are present.
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
b. Check `CLANCY_ROLES` includes `strategist` (or env var is unset, which indicates a global install where all roles are available). If `CLANCY_ROLES` is set but does not include `strategist`:
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
```
|
|
27
|
+
The Strategist role is not enabled. Add "strategist" to CLANCY_ROLES in .clancy/.env or run /clancy:settings.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Stop.
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
### 3. Branch freshness check — run `git fetch origin` and compare the current HEAD with `origin/$CLANCY_BASE_BRANCH` (defaults to `main`). If the local branch is behind:
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
**AFK mode** (`--afk` flag or `CLANCY_MODE=afk`): auto-pull without prompting. Run `git pull origin $CLANCY_BASE_BRANCH` and continue.
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
⚠️ Your local branch is behind origin/{CLANCY_BASE_BRANCH} by {N} commit(s).
|
|
36
|
+
**Interactive mode:**
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
```
|
|
39
|
+
⚠️ Your local branch is behind origin/{CLANCY_BASE_BRANCH} by {N} commit(s).
|
|
40
|
+
|
|
41
|
+
[1] Pull latest
|
|
42
|
+
[2] Continue anyway
|
|
43
|
+
[3] Abort
|
|
44
|
+
```
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
- [1] runs `git pull origin $CLANCY_BASE_BRANCH` and continues
|
|
47
|
+
- [2] continues without pulling
|
|
48
|
+
- [3] stops
|
|
46
49
|
|
|
47
50
|
---
|
|
48
51
|
|
|
@@ -56,7 +59,7 @@ Parse the arguments passed to the command. Arguments can appear in any order.
|
|
|
56
59
|
- **`--fresh`** — discard any existing brief and start over from scratch
|
|
57
60
|
- **`--research`** — force web research agent (adds 1 web agent to the research phase)
|
|
58
61
|
- **`--afk`** — use AI-grill instead of human grill (no interactive questions)
|
|
59
|
-
- **`--epic {KEY}`** — hint for `/clancy:approve-brief`
|
|
62
|
+
- **`--epic {KEY}`** — hint for the approve step later (terminal mode: `/clancy:approve-brief`). Stored in the brief's metadata. Ignored if the input is a board ticket (the source ticket is the parent).
|
|
60
63
|
|
|
61
64
|
### Input modes
|
|
62
65
|
|
|
@@ -82,6 +85,21 @@ If N > 10: `Maximum batch size is 10. Briefing 10 tickets.`
|
|
|
82
85
|
|
|
83
86
|
If `--list` is present (with or without other arguments), jump to Step 11 (Brief Inventory) and stop.
|
|
84
87
|
|
|
88
|
+
### Standalone board-ticket guard
|
|
89
|
+
|
|
90
|
+
If running in **standalone mode** (Step 1 detected no `.clancy/.env`) and the resolved input mode is **board ticket** or **batch mode**:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
Board credentials not found. To brief from a board ticket, install the
|
|
94
|
+
full Clancy pipeline: npx chief-clancy
|
|
95
|
+
|
|
96
|
+
For now, use:
|
|
97
|
+
/clancy:brief "Add dark mode" — inline text
|
|
98
|
+
/clancy:brief --from docs/rfc.md — from a file
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Stop.
|
|
102
|
+
|
|
85
103
|
---
|
|
86
104
|
|
|
87
105
|
## Step 3 — Gather idea (mode-specific)
|
|
@@ -553,7 +571,7 @@ Same relentless energy as the human grill, but directed at the strategist itself
|
|
|
553
571
|
2. Spawn the devil's advocate agent via the Agent tool, passing:
|
|
554
572
|
- The idea text (ticket title + description, or inline text, or file content)
|
|
555
573
|
- The 10-15 generated questions
|
|
556
|
-
- The path to the agent prompt:
|
|
574
|
+
- The path to the agent prompt: `.claude/clancy/agents/devils-advocate.md`
|
|
557
575
|
|
|
558
576
|
3. The devil's advocate agent answers each question by INTERROGATING ITS SOURCES:
|
|
559
577
|
- **Codebase:** explore affected areas, read `.clancy/docs/`, check existing patterns. Don't assume — look.
|
|
@@ -774,7 +792,7 @@ Using all gathered context (idea, grill output, research findings), generate the
|
|
|
774
792
|
|
|
775
793
|
---
|
|
776
794
|
|
|
777
|
-
_Generated by [Clancy](https://github.com/Pushedskydiver/chief-clancy). To answer open questions or request changes: comment on the source ticket or add a ## Feedback section to the brief file, then re-run `/clancy:brief` to revise. To
|
|
795
|
+
_Generated by [Clancy](https://github.com/Pushedskydiver/chief-clancy). To answer open questions or request changes: comment on the source ticket or add a ## Feedback section to the brief file, then re-run `/clancy:brief` to revise. To create tickets: `/clancy:approve-brief` (requires full pipeline — `npx chief-clancy`). To start over: `/clancy:brief --fresh`._
|
|
778
796
|
```
|
|
779
797
|
|
|
780
798
|
### Source field format
|
|
@@ -837,7 +855,9 @@ Write to `.clancy/briefs/{YYYY-MM-DD}-{slug}.md`.
|
|
|
837
855
|
|
|
838
856
|
## Step 10 — Post to board
|
|
839
857
|
|
|
840
|
-
Only for board-sourced briefs (ticket key was provided).
|
|
858
|
+
Only for board-sourced briefs in **terminal mode** (ticket key was provided AND `.clancy/.env` is present). In **standalone mode**, skip this step and Step 10a entirely — the local file in `.clancy/briefs/` is the source of truth.
|
|
859
|
+
|
|
860
|
+
Inline text and file briefs are also local only — skip this step regardless of mode.
|
|
841
861
|
|
|
842
862
|
### GitHub — POST comment
|
|
843
863
|
|
|
@@ -951,7 +971,7 @@ Continue — do not stop. The local file is the source of truth.
|
|
|
951
971
|
|
|
952
972
|
## Step 10a — Apply pipeline label (board-sourced only)
|
|
953
973
|
|
|
954
|
-
Only for board-sourced briefs (ticket key was provided). Inline text and file briefs skip this step.
|
|
974
|
+
Only for board-sourced briefs in **terminal mode** (ticket key was provided AND `.clancy/.env` is present). In **standalone mode**, skip this step entirely (see Step 10 guard). Inline text and file briefs also skip this step.
|
|
955
975
|
|
|
956
976
|
**This step is mandatory for board-sourced briefs — always apply the label.** Use `CLANCY_LABEL_BRIEF` from `.clancy/.env` if set. If not set, use `clancy:brief` as the default. Ensure the label exists on the board (create it if missing), then add it to the ticket. Also read `CLANCY_LABEL_PLAN` (default: `clancy:plan`) and `CLANCY_LABEL_BUILD` (default: `clancy:build`) for cleanup during re-briefs.
|
|
957
977
|
|
|
@@ -1219,7 +1239,8 @@ Clancy — Briefs
|
|
|
1219
1239
|
|
|
1220
1240
|
3 unapproved drafts. 1 stale (>7 days).
|
|
1221
1241
|
|
|
1222
|
-
To approve: /clancy:approve-brief <slug or index>
|
|
1242
|
+
To approve (terminal mode): /clancy:approve-brief <slug or index>
|
|
1243
|
+
To approve (standalone): npx chief-clancy, then /clancy:approve-brief
|
|
1223
1244
|
To review stale briefs: open the file and add ## Feedback, or delete it.
|
|
1224
1245
|
```
|
|
1225
1246
|
|
|
@@ -1253,7 +1274,8 @@ Next Steps
|
|
|
1253
1274
|
• Or add a ## Feedback section to the brief file
|
|
1254
1275
|
Then re-run: /clancy:brief {KEY}
|
|
1255
1276
|
|
|
1256
|
-
Approve: /clancy:approve-brief {KEY}
|
|
1277
|
+
Approve: /clancy:approve-brief {KEY} (terminal mode)
|
|
1278
|
+
Full pipeline: npx chief-clancy (if standalone)
|
|
1257
1279
|
Start over: /clancy:brief --fresh {KEY}
|
|
1258
1280
|
```
|
|
1259
1281
|
|
|
@@ -1271,8 +1293,9 @@ Next Steps
|
|
|
1271
1293
|
.clancy/briefs/{date}-{slug}.feedback.md
|
|
1272
1294
|
Then re-run: /clancy:brief
|
|
1273
1295
|
|
|
1274
|
-
Approve: /clancy:approve-brief {slug}
|
|
1296
|
+
Approve: /clancy:approve-brief {slug} (terminal mode)
|
|
1275
1297
|
With parent: /clancy:approve-brief {slug} --epic {KEY}
|
|
1298
|
+
Full pipeline: npx chief-clancy (if standalone)
|
|
1276
1299
|
Start over: /clancy:brief --fresh
|
|
1277
1300
|
```
|
|
1278
1301
|
|
|
@@ -1307,14 +1330,14 @@ Briefed {M} of {N} tickets. {K} skipped.
|
|
|
1307
1330
|
⏭️ [{KEY3}] {Title} — already briefed
|
|
1308
1331
|
⏭️ [{KEY4}] {Title} — not relevant
|
|
1309
1332
|
|
|
1310
|
-
Briefs saved to .clancy/briefs/.
|
|
1333
|
+
Briefs saved to .clancy/briefs/. To create tickets: /clancy:approve-brief (terminal mode) or install the full pipeline first (npx chief-clancy).
|
|
1311
1334
|
```
|
|
1312
1335
|
|
|
1313
1336
|
---
|
|
1314
1337
|
|
|
1315
1338
|
## Notes
|
|
1316
1339
|
|
|
1317
|
-
- This command does NOT create tickets — it generates briefs only. Ticket creation
|
|
1340
|
+
- This command does NOT create tickets — it generates briefs only. Ticket creation requires the full pipeline (`npx chief-clancy`) and `/clancy:approve-brief`.
|
|
1318
1341
|
- Briefs are saved locally in `.clancy/briefs/` and optionally posted as comments on the source ticket.
|
|
1319
1342
|
- The grill phase is the most important part — do not skip or rush it. Zero ambiguity is the goal.
|
|
1320
1343
|
- Re-running without `--fresh` auto-detects feedback: if feedback exists, revises; if no feedback, stops with guidance.
|
|
@@ -1322,7 +1345,7 @@ Briefs saved to .clancy/briefs/. Run /clancy:approve-brief to create tickets.
|
|
|
1322
1345
|
- The `--list` flag is an inventory display only — no brief generated, no API calls beyond the local filesystem.
|
|
1323
1346
|
- Batch mode (`/clancy:brief 3`) implies AI-grill — each ticket is briefed autonomously.
|
|
1324
1347
|
- All board API calls are best-effort — if a comment fails to post, print the brief and warn. The local file is the source of truth.
|
|
1325
|
-
- The `Clancy Strategic Brief` text in comments is the marker used by
|
|
1348
|
+
- The `Clancy Strategic Brief` text in comments is the marker used by `/clancy:brief` (to detect existing briefs and feedback) and by `/clancy:approve-brief` in terminal mode (to find the brief for ticket creation). Search case-insensitively and match regardless of heading level (`#`, `##`, or plain text).
|
|
1326
1349
|
- Jira uses ADF for comments (with `codeBlock` fallback). GitHub, Linear, and Shortcut accept Markdown directly.
|
|
1327
1350
|
- Linear personal API keys do NOT use `Bearer` prefix.
|
|
1328
1351
|
- Shortcut uses `Shortcut-Token` header (not `Authorization: Bearer`). API base: `https://api.app.shortcut.com/api/v3`. Stories use `name` (not `title`), `description` is markdown, dependencies use `story_links` with `blocks` verb, and workflow state transitions use `workflow_state_id`.
|
|
@@ -44,3 +44,45 @@ describe('workflows directory structure', () => {
|
|
|
44
44
|
expect(content).toContain('.clancy/briefs/');
|
|
45
45
|
});
|
|
46
46
|
});
|
|
47
|
+
|
|
48
|
+
describe('standalone mode adaptations', () => {
|
|
49
|
+
const content = readFileSync(new URL('brief.md', import.meta.url), 'utf8');
|
|
50
|
+
|
|
51
|
+
it('Step 1 uses standalone/terminal mode detection', () => {
|
|
52
|
+
expect(content).toContain('standalone mode');
|
|
53
|
+
expect(content).toContain('terminal mode');
|
|
54
|
+
expect(content).toContain('Detect installation context');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('Step 1 does not hard-stop on missing .clancy/.env', () => {
|
|
58
|
+
expect(content).not.toContain(
|
|
59
|
+
'.clancy/ not found. Run /clancy:init to set up Clancy first.',
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('includes standalone board-ticket guard', () => {
|
|
64
|
+
expect(content).toContain('Standalone board-ticket guard');
|
|
65
|
+
expect(content).toContain('Board credentials not found');
|
|
66
|
+
expect(content).toContain('npx chief-clancy');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('Step 10 includes standalone skip guard', () => {
|
|
70
|
+
expect(content).toContain(
|
|
71
|
+
'In **standalone mode**, skip this step and Step 10a entirely',
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('Step 10a includes standalone skip back-reference', () => {
|
|
76
|
+
expect(content).toContain('see Step 10 guard');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('agent reference uses .claude/clancy/agents/ path', () => {
|
|
80
|
+
expect(content).toContain('.claude/clancy/agents/devils-advocate.md');
|
|
81
|
+
expect(content).not.toContain('src/agents/devils-advocate.md');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('approve-brief references include standalone context', () => {
|
|
85
|
+
expect(content).not.toMatch(/that is `\/clancy:approve-brief`\./);
|
|
86
|
+
expect(content).toContain('npx chief-clancy');
|
|
87
|
+
});
|
|
88
|
+
});
|