@dzhechkov/skills-idea2prd 0.1.0 → 0.1.2

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/bin/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/skills-idea2prd",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Idea2PRD Manual — composite skill for Claude Code: from problem/idea to Vibe-Coding-ready docs (PRD + ADR + DDD + C4 + Pseudocode + Test Scenarios + Completion) with 9 checkpoints",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -46,4 +46,4 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  }
49
- }
49
+ }
@@ -1,418 +1,125 @@
1
1
  ---
2
2
  name: goap-research-ed25519
3
- description: Advanced GOAP research system with Ed25519 cryptographic verification for anti-hallucination protection. Combines Goal-Oriented Action Planning with cryptographic signatures to ensure source authenticity, claim verification, and citation chain integrity. Use for high-stakes research requiring verifiable facts, competitive intelligence, legal/medical research, or any context where hallucination prevention is critical. Triggers on "verified research", "trusted sources only", "anti-hallucination", "signed sources", "cryptographic verification".
3
+ description: GOAP research system with Ed25519 provenance and tamper-evidence under pinned trusted-issuer keys. Use for high-stakes research that needs cited sources, explicit confidence, signed audit trails, or cryptographic proof of who signed a fact. Ed25519 does not prove truthfulness or prevent hallucination.
4
4
  trust_tier: 1
5
5
  trust_tier_label: "Structured"
6
6
  trust_tier_path: "Run /bto-test to promote to Tier 2"
7
7
  ---
8
8
 
9
- # GOAP Research Skill with Ed25519 Verification
9
+ # GOAP Research with Ed25519 Provenance
10
10
 
11
- Advanced research system combining Goal-Oriented Action Planning (GOAP) with Ed25519 cryptographic verification for maximum anti-hallucination protection.
11
+ This skill combines Goal-Oriented Action Planning (GOAP), source evaluation, and optional Ed25519 signatures.
12
12
 
13
- ## Key Differentiators from Standard GOAP
13
+ Ed25519 provides cryptographic provenance and tamper-evidence under pinned trusted-issuer keys: it proves who signed the canonical message and that the signed bytes were not altered. It does not prove that the claim is true, prevent plagiarism, or replace ordinary source evaluation.
14
14
 
15
- | Feature | Standard GOAP | GOAP-Ed25519 |
16
- |---------|---------------|--------------|
17
- | Source Trust | Reliability scoring (1-5) | Cryptographic signatures + scoring |
18
- | Claim Verification | Cross-reference | Cross-reference + signature chain |
19
- | Anti-Hallucination | Triangulation | Triangulation + mandatory citations |
20
- | Audit Trail | Research path log | Signed verification ledger |
21
- | Trust Anchors | Editorial reputation | Trusted issuer whitelist |
15
+ ## Core Rules
22
16
 
23
- ## Ed25519 Verification Architecture
17
+ 1. Every factual claim needs a source URL.
18
+ 2. Unknown, unsigned, revoked, mismatched, or invalid issuer signatures are not issuer-verified.
19
+ 3. Trusted issuer status requires an explicit issuer -> pinned Ed25519 public key mapping. A domain string alone is never trusted.
20
+ 4. Strict and paranoid modes reject plans with remaining unsigned or invalid claims.
21
+ 5. Self-attested researcher signatures provide audit-log tamper-evidence only and are capped below issuer-trusted confidence.
24
22
 
25
- ```
26
- ┌─────────────────────────────────────────────────────────────┐
27
- │ RESEARCH PIPELINE │
28
- ├─────────────────────────────────────────────────────────────┤
29
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
30
- │ │ Source │───▶│ Ed25519 │───▶│ Verified │ │
31
- │ │ Content │ │ Verifier │ │ Facts │ │
32
- │ └──────────┘ └──────────┘ └──────────┘ │
33
- │ │ │ │ │
34
- │ ▼ ▼ ▼ │
35
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
36
- │ │ Citation │ │ Signature│ │ Confidence│ │
37
- │ │ Extractor│ │ Chain │ │ Calculator│ │
38
- │ └──────────┘ └──────────┘ └──────────┘ │
39
- │ │ │ │ │
40
- │ └──────────────┴───────────────┘ │
41
- │ │ │
42
- │ ▼ │
43
- │ ┌────────────────┐ │
44
- │ │ Verification │ │
45
- │ │ Ledger (signed)│ │
46
- │ └────────────────┘ │
47
- └─────────────────────────────────────────────────────────────┘
48
- ```
23
+ ## Trust Classes
49
24
 
50
- ## Core GOAP Methodology (Enhanced)
51
-
52
- ### Phase 1: State Assessment with Trust Initialization
53
-
54
- **Define Current State:**
55
- - Existing knowledge about the topic
56
- - Available sources and access constraints
57
- - **NEW:** Trusted issuer whitelist configuration
58
- - **NEW:** Ed25519 keypair availability
59
- - Time and depth requirements
60
-
61
- **Define Goal State:**
62
- - Specific questions to answer
63
- - Required evidence types
64
- - **NEW:** Minimum verification threshold (0.85 default, 0.95 strict)
65
- - **NEW:** Required signature chain depth
66
- - Confidence thresholds for conclusions
67
-
68
- **Gap Analysis:**
69
- - Knowledge gaps to fill
70
- - **NEW:** Unsigned claims requiring verification
71
- - **NEW:** Citation chain breaks to resolve
72
-
73
- ### Phase 2: Action Inventory (Extended)
74
-
75
- Research actions with Ed25519 verification extensions:
76
-
77
- | Action | Preconditions | Effects | Cost | Verification |
78
- |--------|---------------|---------|------|--------------|
79
- | `web_search_broad` | topic_defined | candidates_found | 1 | None |
80
- | `web_search_verified` | topic_defined, trusted_issuers_set | verified_candidates_found | 2 | Domain signature |
81
- | `fetch_source` | url_known | content_retrieved | 2 | TLS certificate |
82
- | `fetch_signed_source` | url_known, issuer_pubkey | signed_content_retrieved | 3 | Ed25519 signature |
83
- | `extract_facts` | content_retrieved | facts_cataloged | 1 | None |
84
- | `sign_extracted_facts` | facts_cataloged, private_key | signed_facts | 2 | Self-signature |
85
- | `verify_claim` | claim_identified | claim_verified/refuted | 3 | Cross-ref |
86
- | `verify_claim_cryptographic` | claim_identified, signature_available | cryptographically_verified | 4 | Ed25519 verify |
87
- | `cross_reference` | multiple_sources | consistency_checked | 2 | None |
88
- | `cross_reference_signed` | multiple_signed_sources | signed_consistency_checked | 3 | Multi-sig verify |
89
- | `build_citation_chain` | facts_cataloged | citation_chain_complete | 2 | Chain integrity |
90
- | `verify_citation_chain` | citation_chain_complete | chain_verified | 3 | Ed25519 chain |
91
- | `generate_signed_report` | conclusions_formed, private_key | signed_report_delivered | 3 | Report signature |
92
-
93
- ### Phase 3: Plan Generation (A* with Verification Cost)
94
-
95
- Enhanced cost function:
96
- ```
97
- f(n) = g(n) + h(n) + v(n)
98
- ```
99
- - `g(n)`: Actual cost (searches performed, time spent)
100
- - `h(n)`: Heuristic distance to goal (remaining questions)
101
- - `v(n)`: **Verification penalty** (unsigned claims × 0.5)
102
-
103
- **Planning Heuristics:**
104
- 1. Prioritize signed sources over unsigned (lower total cost)
105
- 2. Prefer sources from trusted issuers whitelist
106
- 3. Weight cryptographically verified claims higher
107
- 4. Factor citation chain depth in confidence
108
-
109
- ### Phase 4: OODA Loop with Verification Checkpoints
110
-
111
- **Observe:**
112
- - Monitor search results quality
113
- - **Track signature validity status**
114
- - **Monitor citation chain integrity**
115
- - Identify information gaps
116
-
117
- **Orient:**
118
- - Assess if current path leads to goal
119
- - **Evaluate cryptographic trust level**
120
- - **Check for signature chain breaks**
121
- - Recognize when verification fails
122
-
123
- **Decide:**
124
- - Continue current research branch or pivot
125
- - **Accept or reject unsigned sources**
126
- - **Trigger re-verification on suspicious content**
127
- - Choose between depth and breadth
128
-
129
- **Act:**
130
- - Execute next optimal action
131
- - **Sign verified findings**
132
- - **Update verification ledger**
133
- - Trigger replanning if deviation detected
134
-
135
- ### Phase 5: Dynamic Replanning with Trust Recalculation
136
-
137
- Trigger replanning when:
138
- - Key assumption invalidated
139
- - **Signature verification fails**
140
- - **Trusted issuer removed from whitelist**
141
- - **Citation chain broken**
142
- - Higher-quality signed source discovered
143
-
144
- ## Ed25519 Verification Protocol
145
-
146
- ### Trusted Issuers Whitelist
147
-
148
- Default trusted issuers (Level 5 sources):
149
- ```yaml
150
- trusted_issuers:
151
- news:
152
- - reuters.com
153
- - ap.org
154
- - bbc.com
155
- academic:
156
- - arxiv.org
157
- - nature.com
158
- - science.org
159
- - pubmed.gov
160
- government:
161
- - .gov domains
162
- - .gov.uk domains
163
- - europa.eu
164
- financial:
165
- - sec.gov
166
- - federalreserve.gov
167
- - ecb.europa.eu
168
- ```
25
+ | Trust class | Requirement | What it proves | Confidence |
26
+ |---|---|---|---|
27
+ | `ISSUER_SIGNED` | Signature verifies against the active pinned key for the claimed issuer | The pinned issuer signed this exact canonical message | up to `0.95` |
28
+ | `SELF_ATTESTED` | Researcher signature verifies against the embedded researcher key | The research record was not altered after self-signing | up to `0.60` |
29
+ | `UNVERIFIED` | Unknown issuer, missing pin, revoked key, key mismatch, malformed key, or invalid signature | No cryptographic provenance | `0.0` |
169
30
 
170
- ### Signature Verification Flow
31
+ ## Signed Message
171
32
 
172
- ```
173
- 1. Source provides content + signature + public_key_id
174
- 2. Fetch public key from trusted keyserver or issuer
175
- 3. Verify Ed25519 signature: verify(signature, content_hash, public_key)
176
- 4. Check issuer against trusted whitelist
177
- 5. Record verification result in ledger
178
- 6. Assign cryptographic trust score
179
- ```
33
+ `sign_fact()` and `verify_fact()` use the same deterministic JSON message containing:
180
34
 
181
- ### Citation Chain Verification
182
-
183
- Each fact in the chain must have:
184
- ```json
185
- {
186
- "claim": "The statement being made",
187
- "source_url": "https://...",
188
- "source_hash": "sha256:abc123...",
189
- "issuer_pubkey": "ed25519:xyz789...",
190
- "signature": "ed25519_sig:...",
191
- "timestamp": "2025-01-22T10:30:00Z",
192
- "parent_citation": "chain_id:previous_fact_id",
193
- "confidence": 0.95
194
- }
195
- ```
35
+ - `issuer`
36
+ - `source_url`
37
+ - `claim`
38
+ - `source_hash`
39
+ - `timestamp`
40
+ - optional `research_context` / nonce
196
41
 
197
- Chain verification:
198
- 1. Verify each fact's signature individually
199
- 2. Verify chain integrity (parent hashes match)
200
- 3. Check all issuers are in trusted whitelist
201
- 4. Calculate aggregate chain confidence
42
+ Changing the issuer or moving the source URL after signing invalidates the signature. The code signs the raw canonical message bytes; Ed25519 performs its own internal hashing. Do not pre-hash with SHA-512 before signing.
202
43
 
203
- ## Anti-Hallucination Rules
44
+ ## Pinned Issuers
204
45
 
205
- ### 100% Citation Rule
206
- **Every factual claim MUST have a verifiable source.** No exceptions.
46
+ The default pinned issuer registry is empty. Add real keys explicitly:
207
47
 
208
- ```
209
- FORBIDDEN: "Studies show that X leads to Y"
210
- ✅ REQUIRED: "A 2024 study published in Nature (DOI: 10.1038/...) found that X leads to Y"
48
+ ```python
49
+ verifier = Ed25519Verifier(
50
+ trusted_issuers={
51
+ "example.org": {"pubkey_b64": "base64-public-key", "status": "active"}
52
+ }
53
+ )
211
54
  ```
212
55
 
213
- ### Verification Thresholds
56
+ `status: revoked` rejects the key. Online revocation fetching is not implemented. Replay protection is limited to binding `research_context` / nonce into the signed message; there is no persistent nonce ledger.
214
57
 
215
- | Mode | Threshold | Use Case |
216
- |------|-----------|----------|
217
- | `development` | 0.75 | Exploratory research, brainstorming |
218
- | `moderate` | 0.85 | Standard research (default) |
219
- | `strict` | 0.95 | Legal, medical, financial research |
220
- | `paranoid` | 0.99 | Critical decisions, published reports |
58
+ ## Citation Chain Verification
221
59
 
222
- ### Confidence Calculation
60
+ Each non-root fact stores `parent_hash = sha256(canonical_message(parent_fact))`. Chain verification:
223
61
 
224
- ```
225
- confidence = base_reliability × verification_multiplier × recency_factor
62
+ 1. Verifies each fact signature.
63
+ 2. Recomputes each parent content hash and compares it to the child's `parent_hash`.
64
+ 3. Verifies `chain_signature` over the ordered list of fact hashes.
226
65
 
227
- where:
228
- base_reliability = source level (1-5) / 5
229
- verification_multiplier = 1.0 if unsigned, 1.2 if signed, 1.5 if chain_verified
230
- recency_factor = 1.0 if <24h, 0.9 if <7d, 0.8 if <30d, 0.6 if older
231
- ```
66
+ Reordering, substituting, editing, relabeling, or moving a signed fact fails verification.
232
67
 
233
- ## Research Execution Patterns (Enhanced)
68
+ ## GOAP Research Modes
234
69
 
235
- ### Pattern A: Verified Exploratory Research
236
- ```
237
- Goal: comprehensive_verified_understanding
238
- Actions:
239
- 1. configure_trusted_issuers whitelist_active
240
- 2. web_search_verified verified_candidates_found
241
- 3. FOR EACH candidate: fetch_signed_source → signed_content_retrieved
242
- 4. extract_facts → facts_cataloged
243
- 5. sign_extracted_facts → signed_facts
244
- 6. cross_reference_signed → signed_consistency_checked
245
- 7. build_citation_chain → citation_chain_complete
246
- 8. verify_citation_chain → chain_verified
247
- 9. synthesize_findings → conclusions_formed
248
- 10. generate_signed_report → signed_report_delivered
249
- ```
70
+ | Mode | Behavior |
71
+ |---|---|
72
+ | `development` | Allows unsigned claims with clear labels and lower confidence. |
73
+ | `moderate` | Prefers signed and cross-checked sources but may continue with labeled uncertainty. |
74
+ | `strict` | Rejects plans with unsigned, invalid, unknown, revoked, or mismatched claims. |
75
+ | `paranoid` | Same as strict, with stronger source redundancy expectations. |
250
76
 
251
- ### Pattern B: High-Stakes Fact Verification
252
- ```
253
- Goal: cryptographically_verified_claim
254
- Mode: strict (0.95 threshold)
255
- Actions:
256
- 1. identify_claim → claim_defined
257
- 2. configure_trusted_issuers (strict list) → whitelist_active
258
- 3. find_primary_source → primary_located
259
- 4. fetch_signed_source → signed_content_retrieved
260
- 5. verify_claim_cryptographic → cryptographically_verified
261
- 6. cross_reference_signed (≥3 sources) → multi_source_verified
262
- 7. build_citation_chain → citation_chain_complete
263
- 8. verify_citation_chain → chain_verified (confidence ≥0.95)
264
- ```
77
+ ## Confidence Formula
265
78
 
266
- ### Pattern C: Competitive Analysis with Audit Trail
267
79
  ```
268
- Goal: auditable_competitive_landscape
269
- Actions:
270
- 1. identify_players → competitors_listed
271
- 2. configure_trusted_issuers whitelist_active
272
- 3. FOR EACH competitor:
273
- - web_search_verified → verified_info_found
274
- - fetch_signed_source (official sources) → signed_content
275
- - extract_facts → facts_cataloged
276
- - sign_extracted_facts → signed_facts
277
- 4. cross_reference_signed → consistency_verified
278
- 5. build_citation_chain → full_chain
279
- 6. generate_signed_report → auditable_report
80
+ confidence =
81
+ 0.0 if UNVERIFIED
82
+ <=0.60 if SELF_ATTESTED
83
+ min(0.95, base_by_source_level * recency_factor) if ISSUER_SIGNED
280
84
  ```
281
85
 
282
- ## Output Structure (Enhanced)
283
-
284
- ### Verified Research Report Format
285
-
286
- ```markdown
287
- ## Executive Summary
288
- [Key findings in 2-3 sentences]
289
-
290
- ## Verification Status
291
- - Mode: strict (0.95 threshold)
292
- - Chain Integrity: ✅ VERIFIED
293
- - Unsigned Claims: 0
294
- - Total Citations: 15
295
- - Trusted Issuers Used: 8
86
+ Invalid signatures are rejected with confidence `0.0`; they are never a recoverable `0.5` penalty.
296
87
 
297
- ## Research Objective
298
- [Original question/goal]
88
+ ## Research Workflow
299
89
 
300
- ## Methodology
301
- [GOAP plan executed, verification protocol used]
90
+ 1. Define the research goal and required evidence threshold.
91
+ 2. Configure pinned issuer keys when issuer-grade provenance is required.
92
+ 3. Search and fetch sources.
93
+ 4. Extract claims and source URLs.
94
+ 5. Hash source content with SHA-256 for `source_hash`.
95
+ 6. Create self-attested facts for the research ledger or issuer-signed facts when a pinned issuer key actually signed the message.
96
+ 7. Verify facts and citation chains.
97
+ 8. Cross-check claims through ordinary source evaluation.
98
+ 9. Report confidence, unsigned claims, rejected signatures, and limitations explicitly.
302
99
 
303
- ## Verified Findings
100
+ ## Output Expectations
304
101
 
305
- ### [Subtopic 1]
306
- [Findings with signed inline citations]
102
+ Reports should include:
307
103
 
308
- **Verification Details:**
309
- | Claim | Source | Signature | Confidence |
310
- |-------|--------|-----------|------------|
311
- | ... | ... | | 0.96 |
312
-
313
- ### [Subtopic 2]
314
- [Findings with signed inline citations]
315
-
316
- ## Confidence Assessment
317
- - Cryptographically Verified (≥0.95): [claims list]
318
- - Cross-Reference Verified (0.85-0.95): [claims list]
319
- - Single Source (0.75-0.85): [claims list]
320
- - Unverified (<0.75): NONE (strict mode)
321
-
322
- ## Citation Chain
323
- [Full chain with signatures - see Appendix A]
324
-
325
- ## Verification Ledger
326
- [Signed log of all verification operations]
327
-
328
- ## Sources
329
- [Numbered list with URLs, signatures, and trust scores]
330
-
331
- ## Appendix A: Cryptographic Verification Details
332
- [Full Ed25519 signature data for audit]
333
- ```
334
-
335
- ## Quality Standards (Enhanced)
336
-
337
- **Completeness Checks:**
338
- - [ ] All original questions addressed
339
- - [ ] **100% of claims have citations**
340
- - [ ] **All citations are verifiable**
341
- - [ ] **Citation chain integrity verified**
342
- - [ ] Primary sources found where possible
343
- - [ ] Contradictions identified and addressed
344
- - [ ] Confidence levels assigned to conclusions
345
- - [ ] **Verification ledger signed and complete**
346
-
347
- **Anti-Hallucination Checks:**
348
- - [ ] No claims without sources
349
- - [ ] No "studies show" without specific citation
350
- - [ ] No statistics without methodology source
351
- - [ ] No quotes without attribution + verification
352
- - [ ] No predictions presented as facts
104
+ - Research objective and GOAP plan executed.
105
+ - Findings with source URLs.
106
+ - Verification status per claim (`ISSUER_SIGNED`, `SELF_ATTESTED`, or `UNVERIFIED`).
107
+ - Chain integrity result when citation chains are used.
108
+ - Unsigned and rejected claims.
109
+ - Explicit caveat that cryptographic provenance is not truth verification.
353
110
 
354
111
  ## Implementation
355
112
 
356
- ### Python Usage
357
-
358
- ```python
359
- from goap_planner import GOAPResearchPlanner
360
- from ed25519_verifier import Ed25519Verifier
361
-
362
- # Initialize with Ed25519 verification
363
- planner = GOAPResearchPlanner(
364
- verification_mode="strict",
365
- trusted_issuers=["reuters.com", "ap.org", "nature.com"]
366
- )
367
-
368
- # Generate research plan
369
- plan = planner.plan(
370
- goal_type="verified_exploratory",
371
- topic="AI safety regulations 2025"
372
- )
373
-
374
- # Execute with verification
375
- results = planner.execute(plan, verify_all=True)
113
+ Use the scripts in this skill:
376
114
 
377
- # Generate signed report
378
- report = planner.generate_report(
379
- results,
380
- sign=True,
381
- include_verification_ledger=True
382
- )
383
- ```
115
+ - [scripts/ed25519_verifier.py](scripts/ed25519_verifier.py)
116
+ - [scripts/goap_planner.py](scripts/goap_planner.py)
384
117
 
385
- ### CLI Usage (via goalie integration)
118
+ Install Python crypto dependencies in a virtual environment:
386
119
 
387
120
  ```bash
388
- # Install goalie for Ed25519 support
389
- npm install -g goalie
390
-
391
- # Verified research
392
- goalie search "Your research question" \
393
- --verify \
394
- --strict-verify \
395
- --trusted-issuers "reuters.com,ap.org,nature.com" \
396
- --mode academic \
397
- --save
398
-
399
- # Anti-hallucination check
400
- goalie reason --mode anti-hallucination \
401
- --claims "Your claim to verify" \
402
- --citations "Source URL"
121
+ python3 -m venv .venv
122
+ .venv/bin/pip install cryptography
403
123
  ```
404
124
 
405
- ## References
406
-
407
- For detailed implementations, see:
408
- - [references/research-actions.md](references/research-actions.md) - Complete action specifications with Ed25519 extensions
409
- - [references/source-evaluation.md](references/source-evaluation.md) - Source credibility with cryptographic trust
410
- - [references/ed25519-verification.md](references/ed25519-verification.md) - Ed25519 protocol details
411
- - [scripts/goap_planner.py](scripts/goap_planner.py) - Enhanced GOAP planner
412
- - [scripts/ed25519_verifier.py](scripts/ed25519_verifier.py) - Verification module
413
-
414
- ## Dependencies
415
-
416
- - Python 3.9+
417
- - `@noble/ed25519` (Node.js) or `cryptography` (Python) for Ed25519
418
- - Optional: `goalie` npm package for CLI integration
125
+ Use `--break-system-packages` only as a last-resort local workaround when you understand the system-integrity risk.