@a-company/paradigm 3.1.6 → 3.6.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/dist/{accept-orchestration-CWZNCGZX.js → accept-orchestration-DIGPJVUR.js} +6 -5
- package/dist/{aggregate-W7Q6VIM2.js → aggregate-V4KPR3RW.js} +2 -2
- package/dist/{beacon-B47XSTL7.js → beacon-XRXL5KZB.js} +2 -2
- package/dist/{chunk-YCLN7WXV.js → chunk-2QNZ6PVD.js} +219 -35
- package/dist/{chunk-UM54F7G5.js → chunk-4N6AYEEA.js} +1 -1
- package/dist/{chunk-MVXJVRFI.js → chunk-5TUAVVIG.js} +65 -1
- package/dist/{chunk-5C4SGQKH.js → chunk-6P4IFIK2.js} +4 -2
- package/dist/{chunk-WS5KM7OL.js → chunk-6RNYVBSG.js} +1 -1
- package/dist/{chunk-VZ7CXFRZ.js → chunk-ADOBV4PH.js} +1387 -17
- package/dist/{chunk-N6PJAPDE.js → chunk-AK5M6KJB.js} +18 -0
- package/dist/{chunk-4LGLU2LO.js → chunk-GY5KO3YZ.js} +679 -183
- package/dist/{chunk-MC7XC7XQ.js → chunk-GZDFVP2N.js} +20 -13
- package/dist/chunk-HPC3JAUP.js +42 -0
- package/dist/chunk-IRVA7NKV.js +657 -0
- package/dist/{chunk-ZPN7MXRA.js → chunk-KFHK6EBI.js} +184 -1
- package/dist/{chunk-UUZ2DMG5.js → chunk-KWDTBXP2.js} +1 -1
- package/dist/{chunk-HXY6AY52.js → chunk-M2XMTJHQ.js} +667 -70
- package/dist/{chunk-PW2EXJQT.js → chunk-MRENOFTR.js} +24 -1
- package/dist/{chunk-QS36NGWV.js → chunk-QHJGB5TV.js} +1 -1
- package/dist/chunk-UI3XXVJ6.js +449 -0
- package/dist/{chunk-AD2LSCHB.js → chunk-Y4XZWCHK.js} +40 -74
- package/dist/{constellation-K3CIQCHI.js → constellation-GNK5DIMH.js} +2 -2
- package/dist/{cost-AEK6R7HK.js → cost-AGO5N7DD.js} +1 -1
- package/dist/{cursorrules-KI5QWHIX.js → cursorrules-LQFA7M62.js} +2 -2
- package/dist/{delete-W67IVTLJ.js → delete-3YXAJ5AA.js} +12 -1
- package/dist/{diff-AJJ5H6HV.js → diff-J6C5IHPV.js} +6 -5
- package/dist/{dist-2F7NO4H4-KSL6SJIO.js → dist-AG5JNIZU-XSEZ2LLK.js} +28 -3
- package/dist/dist-JOHRYQUA.js +7294 -0
- package/dist/{dist-GPQ4LAY3.js → dist-OLFOTUHS.js} +26 -6
- package/dist/{dist-NHJQVVUW.js → dist-Q6SAZI7X.js} +2 -2
- package/dist/{doctor-JBIV5PMN.js → doctor-TQYRF7KK.js} +2 -2
- package/dist/{edit-Y7XPYSMK.js → edit-EOMPXOG5.js} +1 -1
- package/dist/flow-7JUH6D4H.js +185 -0
- package/dist/global-AXILUM5X.js +136 -0
- package/dist/{habits-FA65W77Y.js → habits-ZJBAL4HD.js} +234 -5
- package/dist/{hooks-RLJFGKPF.js → hooks-DLZEYHI3.js} +1 -1
- package/dist/index.js +125 -100
- package/dist/{lint-HXKTWRNO.js → lint-N4LMMEXH.js} +141 -1
- package/dist/{list-R3QWW4SC.js → list-JKBJ7ESH.js} +1 -1
- package/dist/mcp.js +7982 -5065
- package/dist/{orchestrate-4ZH5GUQH.js → orchestrate-FAV64G2R.js} +6 -5
- package/dist/{probe-OYCP4JYG.js → probe-X3J2JX62.js} +18 -3
- package/dist/{promote-E6NBZ3BK.js → promote-HZH5E5CO.js} +1 -1
- package/dist/{providers-4PGPZEWP.js → providers-NQ67LO2Z.js} +1 -1
- package/dist/{record-OHQNWOUP.js → record-EECZ3E4I.js} +1 -1
- package/dist/{remember-6VZ74B7E.js → remember-3KJZGDUG.js} +1 -1
- package/dist/{review-RUHX25A5.js → review-BF26ILZB.js} +1 -1
- package/dist/{ripple-SBQOSTZD.js → ripple-JIUAMBLA.js} +2 -2
- package/dist/sentinel-KDIGZWKT.js +63 -0
- package/dist/{server-MV4HNFVF.js → server-NN7WDAZJ.js} +4413 -9
- package/dist/{setup-DF4F3ICN.js → setup-363IB6MO.js} +1 -1
- package/dist/{setup-JHBPZAG7.js → setup-UKJ3VGHI.js} +4 -4
- package/dist/{shift-YELZUPYG.js → shift-KDVYB6CR.js} +16 -13
- package/dist/{show-WTOJXUTN.js → show-SAMTXEHG.js} +1 -1
- package/dist/{snapshot-GTVPRYZG.js → snapshot-KCMONZAO.js} +2 -2
- package/dist/{spawn-BJRQA2NR.js → spawn-EO7B2UM3.js} +2 -2
- package/dist/{summary-5SBFO7QK.js → summary-E2PU4UN2.js} +3 -3
- package/dist/{switch-6EANJ7O6.js → switch-CC2KACXO.js} +1 -1
- package/dist/{sync-5KSTPJ4B.js → sync-5VJPZQNX.js} +2 -2
- package/dist/sync-llms-7QDA3ZWC.js +166 -0
- package/dist/{team-NWP2KJAB.js → team-6CCNANKE.js} +7 -6
- package/dist/{test-MA5TWJQV.js → test-DK2RWLTK.js} +91 -8
- package/dist/{thread-JCJVRUQR.js → thread-RNSLADXN.js} +18 -2
- package/dist/{timeline-P7BARFLI.js → timeline-TJDVVVA3.js} +1 -1
- package/dist/{triage-TBIWJA6R.js → triage-B5W6GZLT.js} +2 -2
- package/dist/university-content/courses/para-101.json +2 -1
- package/dist/university-content/courses/para-201.json +102 -3
- package/dist/university-content/courses/para-301.json +14 -11
- package/dist/university-content/courses/para-401.json +57 -3
- package/dist/university-content/courses/para-501.json +204 -6
- package/dist/university-content/plsat/v3.0.json +808 -3
- package/dist/university-content/reference.json +270 -0
- package/dist/{upgrade-TIYFQYPO.js → upgrade-RBSE4M6I.js} +1 -1
- package/dist/{validate-QEEY6KFS.js → validate-2LTHHORX.js} +1 -1
- package/dist/{watch-4LT4O6K7.js → watch-NBPOMOEX.js} +76 -0
- package/dist/{watch-2XEYUH43.js → watch-PAEH6MOG.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-GWM2WRXL.js +0 -1095
- package/dist/sentinel-WB7GIK4V.js +0 -43
- /package/dist/{chunk-TAP5N3HH.js → chunk-CCG6KYBT.js} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BackgroundOrchestrator
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y4XZWCHK.js";
|
|
5
5
|
import "./chunk-6QC3YGB6.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-HPC3JAUP.js";
|
|
7
|
+
import "./chunk-6RNYVBSG.js";
|
|
7
8
|
import "./chunk-PBHIFAL4.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-CCG6KYBT.js";
|
|
9
10
|
import "./chunk-PMXRGPRQ.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-6P4IFIK2.js";
|
|
12
|
+
import "./chunk-MRENOFTR.js";
|
|
12
13
|
import "./chunk-IRKUEJVW.js";
|
|
13
14
|
import "./chunk-5JGJACDU.js";
|
|
14
15
|
import "./chunk-MO4EEYFW.js";
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
buildSymbolIndex,
|
|
6
6
|
getSymbolCounts,
|
|
7
7
|
parsePremiseFile
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-6P4IFIK2.js";
|
|
9
|
+
import "./chunk-MRENOFTR.js";
|
|
10
10
|
import "./chunk-IRKUEJVW.js";
|
|
11
11
|
import "./chunk-MO4EEYFW.js";
|
|
12
12
|
|
|
@@ -405,6 +405,75 @@ function generateCheckpointProtocol() {
|
|
|
405
405
|
lines.push("");
|
|
406
406
|
return lines.join("\n");
|
|
407
407
|
}
|
|
408
|
+
function generateHabitsSection() {
|
|
409
|
+
const lines = [];
|
|
410
|
+
lines.push("## Habits Compliance");
|
|
411
|
+
lines.push("");
|
|
412
|
+
lines.push("Paradigm tracks behavioral habits \u2014 repeatable practices that improve code quality.");
|
|
413
|
+
lines.push("");
|
|
414
|
+
lines.push("### When to Check Habits");
|
|
415
|
+
lines.push("");
|
|
416
|
+
lines.push("| Trigger | When | Tool |");
|
|
417
|
+
lines.push("|---------|------|------|");
|
|
418
|
+
lines.push('| `preflight` | Before starting implementation | `paradigm_habits_check({ trigger: "preflight" })` |');
|
|
419
|
+
lines.push('| `postflight` | After completing implementation | `paradigm_habits_check({ trigger: "postflight" })` |');
|
|
420
|
+
lines.push('| `on-stop` | Before ending a session | `paradigm_habits_check({ trigger: "on-stop" })` |');
|
|
421
|
+
lines.push("");
|
|
422
|
+
lines.push("### Key Habit Categories");
|
|
423
|
+
lines.push("");
|
|
424
|
+
lines.push("| Category | Examples |");
|
|
425
|
+
lines.push("|----------|----------|");
|
|
426
|
+
lines.push("| Discovery | Call `paradigm_ripple` before modifying symbols |");
|
|
427
|
+
lines.push("| Security | Declare gates for new routes in portal.yaml |");
|
|
428
|
+
lines.push("| Documentation | Update .purpose files for modified components |");
|
|
429
|
+
lines.push("| Quality | Record lore for sessions modifying 3+ files |");
|
|
430
|
+
lines.push("");
|
|
431
|
+
lines.push("Use `paradigm_practice_context` before modifying symbols to get habit-aware warnings.");
|
|
432
|
+
lines.push("");
|
|
433
|
+
return lines.join("\n");
|
|
434
|
+
}
|
|
435
|
+
function generateLoreSection() {
|
|
436
|
+
const lines = [];
|
|
437
|
+
lines.push("## Lore Recording");
|
|
438
|
+
lines.push("");
|
|
439
|
+
lines.push("Lore captures the project timeline \u2014 sessions, decisions, milestones, and incidents.");
|
|
440
|
+
lines.push("");
|
|
441
|
+
lines.push("### When to Record Lore");
|
|
442
|
+
lines.push("");
|
|
443
|
+
lines.push("| Type | When | Example |");
|
|
444
|
+
lines.push("|------|------|---------|");
|
|
445
|
+
lines.push('| `agent-session` | After modifying 3+ files | "Added JWT auth to /api/projects" |');
|
|
446
|
+
lines.push('| `decision` | After making architectural choices | "Chose Redis over Memcached for caching" |');
|
|
447
|
+
lines.push('| `milestone` | After completing a significant feature | "v2.0 migration complete" |');
|
|
448
|
+
lines.push('| `incident` | After resolving a production issue | "Fixed OOM in payment worker" |');
|
|
449
|
+
lines.push("");
|
|
450
|
+
lines.push("### Recording");
|
|
451
|
+
lines.push("");
|
|
452
|
+
lines.push("```");
|
|
453
|
+
lines.push("paradigm_lore_record({");
|
|
454
|
+
lines.push(' type: "agent-session",');
|
|
455
|
+
lines.push(' title: "Short description of work done",');
|
|
456
|
+
lines.push(' summary: "Detailed summary of changes...",');
|
|
457
|
+
lines.push(' symbols_touched: ["#component", "^gate"]');
|
|
458
|
+
lines.push("})");
|
|
459
|
+
lines.push("```");
|
|
460
|
+
lines.push("");
|
|
461
|
+
lines.push("Use `paradigm_lore_timeline` at session start for project history orientation.");
|
|
462
|
+
lines.push("");
|
|
463
|
+
return lines.join("\n");
|
|
464
|
+
}
|
|
465
|
+
function generateLlmsTxtSection() {
|
|
466
|
+
const lines = [];
|
|
467
|
+
lines.push("## llms.txt");
|
|
468
|
+
lines.push("");
|
|
469
|
+
lines.push("This project provides an `llms.txt` file at the repository root \u2014 a plain-text summary");
|
|
470
|
+
lines.push("of the project optimized for LLM consumption. It includes symbols, key files, flows,");
|
|
471
|
+
lines.push("gates, and conventions.");
|
|
472
|
+
lines.push("");
|
|
473
|
+
lines.push("Regenerate with: `paradigm sync-llms`");
|
|
474
|
+
lines.push("");
|
|
475
|
+
return lines.join("\n");
|
|
476
|
+
}
|
|
408
477
|
function generateFooter() {
|
|
409
478
|
const lines = [];
|
|
410
479
|
lines.push("---");
|
|
@@ -471,6 +540,10 @@ ${f.content}`).join("\n\n---\n\n");
|
|
|
471
540
|
path: "paradigm-core.mdc",
|
|
472
541
|
content: this.generateCoreRules(projectName, config)
|
|
473
542
|
});
|
|
543
|
+
generatedFiles.push({
|
|
544
|
+
path: "paradigm-workflow.mdc",
|
|
545
|
+
content: this.generateWorkflowMdc()
|
|
546
|
+
});
|
|
474
547
|
generatedFiles.push({
|
|
475
548
|
path: "paradigm-symbols.mdc",
|
|
476
549
|
content: this.generateSymbolRules(config)
|
|
@@ -519,6 +592,10 @@ ${f.content}`).join("\n\n---\n\n");
|
|
|
519
592
|
path: "paradigm-flows.mdc",
|
|
520
593
|
content: this.generateFlowsMdc()
|
|
521
594
|
});
|
|
595
|
+
generatedFiles.push({
|
|
596
|
+
path: "paradigm-practices.mdc",
|
|
597
|
+
content: this.generatePracticesMdc()
|
|
598
|
+
});
|
|
522
599
|
generatedFiles.push({
|
|
523
600
|
path: "paradigm-commits.mdc",
|
|
524
601
|
content: this.generateCommitsMdc()
|
|
@@ -534,6 +611,14 @@ ${f.content}`).join("\n\n---\n\n");
|
|
|
534
611
|
|
|
535
612
|
> **Author:** Matt Canoy ([@ascend42](https://github.com/ascend42)) | **Repo:** [github.com/ascend42/a-paradigm](https://github.com/ascend42/a-paradigm) | **npm:** [@a-company/paradigm](https://www.npmjs.com/package/@a-company/paradigm)
|
|
536
613
|
|
|
614
|
+
## CRITICAL RULES (Non-Negotiable)
|
|
615
|
+
|
|
616
|
+
1. **You MUST update the nearest \`.purpose\` file when you change behavior.** No exceptions.
|
|
617
|
+
2. **You MUST call \`paradigm_session_recover\` at session start and \`paradigm_pm_postflight\` when finishing.** See \`paradigm-workflow.mdc\` for the full protocol.
|
|
618
|
+
3. **You MUST call \`paradigm_ripple\` before modifying any documented symbol.** Check impact before changing code.
|
|
619
|
+
|
|
620
|
+
Violating these rules means your changes are non-compliant. The \`paradigm-workflow.mdc\` file contains the complete workflow \u2014 follow it.
|
|
621
|
+
|
|
537
622
|
` + overview + "\n\n" + generateUpdateRules(config);
|
|
538
623
|
}
|
|
539
624
|
/**
|
|
@@ -660,74 +745,78 @@ gate.allow('Access granted');
|
|
|
660
745
|
}) + generateConventions(config);
|
|
661
746
|
}
|
|
662
747
|
/**
|
|
663
|
-
* Agent Hints -
|
|
748
|
+
* Agent Hints - MCP-first queries for AI agents
|
|
664
749
|
*/
|
|
665
750
|
generateAgentHintsMdc() {
|
|
666
|
-
return frontmatter("Paradigm
|
|
751
|
+
return frontmatter("Paradigm MCP tool queries for AI agents - use MCP tools instead of reading large files or running CLI commands", {
|
|
667
752
|
alwaysApply: true
|
|
668
|
-
}) + `# Agent
|
|
753
|
+
}) + `# Agent MCP Queries (Token-Efficient)
|
|
669
754
|
|
|
670
|
-
|
|
755
|
+
**Use MCP tool calls, NOT CLI commands.** MCP tools return structured data directly \u2014 no shell overhead, no parsing, no latency.
|
|
671
756
|
|
|
672
757
|
## When to Query
|
|
673
758
|
|
|
674
|
-
| Before doing this... |
|
|
675
|
-
|
|
676
|
-
| Modifying a symbol | \`
|
|
677
|
-
| Debugging
|
|
678
|
-
| Starting a session | \`
|
|
679
|
-
| Understanding relationships | \`
|
|
680
|
-
| Getting oriented | \`
|
|
759
|
+
| Before doing this... | Call this MCP tool |
|
|
760
|
+
|---------------------|-------------------|
|
|
761
|
+
| Modifying a symbol | \`paradigm_ripple({ symbol: "#symbol" })\` |
|
|
762
|
+
| Debugging / searching | \`paradigm_search({ query: "ERROR_CODE" })\` |
|
|
763
|
+
| Starting a session | \`paradigm_session_recover()\` |
|
|
764
|
+
| Understanding relationships | \`paradigm_navigate({ intent: "find", target: "#symbol" })\` |
|
|
765
|
+
| Getting oriented | \`paradigm_status()\` |
|
|
766
|
+
| Checking impact on flows | \`paradigm_flows_affected({ symbol: "#symbol" })\` |
|
|
767
|
+
| Adding API endpoints | \`paradigm_gates_for_route({ method: "POST", path: "/api/resource" })\` |
|
|
681
768
|
|
|
682
769
|
## Query Patterns
|
|
683
770
|
|
|
684
771
|
### Before Changing Code
|
|
685
772
|
|
|
686
|
-
\`\`\`
|
|
687
|
-
|
|
688
|
-
|
|
773
|
+
\`\`\`
|
|
774
|
+
// See what depends on what you're changing
|
|
775
|
+
paradigm_ripple({ symbol: "#checkout" })
|
|
689
776
|
|
|
690
|
-
|
|
777
|
+
// Returns: upstream deps, downstream effects, flow membership
|
|
691
778
|
\`\`\`
|
|
692
779
|
|
|
693
780
|
### When Debugging
|
|
694
781
|
|
|
695
|
-
\`\`\`
|
|
696
|
-
|
|
697
|
-
|
|
782
|
+
\`\`\`
|
|
783
|
+
// Search for error context
|
|
784
|
+
paradigm_search({ query: "AUTH_REQUIRED" })
|
|
698
785
|
|
|
699
|
-
|
|
700
|
-
|
|
786
|
+
// Then check ripple effects of the related symbol
|
|
787
|
+
paradigm_ripple({ symbol: "^authenticated" })
|
|
701
788
|
\`\`\`
|
|
702
789
|
|
|
703
790
|
### Starting Work
|
|
704
791
|
|
|
705
|
-
\`\`\`
|
|
706
|
-
|
|
707
|
-
|
|
792
|
+
\`\`\`
|
|
793
|
+
// Load previous session context (MUST do this at session start)
|
|
794
|
+
paradigm_session_recover()
|
|
708
795
|
|
|
709
|
-
|
|
710
|
-
|
|
796
|
+
// Quick project orientation
|
|
797
|
+
paradigm_status()
|
|
711
798
|
\`\`\`
|
|
712
799
|
|
|
713
|
-
###
|
|
800
|
+
### Finding Code Locations
|
|
714
801
|
|
|
715
|
-
\`\`\`
|
|
716
|
-
|
|
717
|
-
|
|
802
|
+
\`\`\`
|
|
803
|
+
// Find a specific symbol
|
|
804
|
+
paradigm_navigate({ intent: "find", target: "#checkout" })
|
|
718
805
|
|
|
719
|
-
|
|
720
|
-
|
|
806
|
+
// Explore an area of code
|
|
807
|
+
paradigm_navigate({ intent: "explore", target: "authentication" })
|
|
721
808
|
|
|
722
|
-
|
|
723
|
-
|
|
809
|
+
// Get context for a task
|
|
810
|
+
paradigm_navigate({ intent: "context", task: "add Apple Pay" })
|
|
724
811
|
\`\`\`
|
|
725
812
|
|
|
726
|
-
##
|
|
813
|
+
## Why MCP Over CLI
|
|
727
814
|
|
|
815
|
+
- **No shell overhead**: Direct structured responses, no \`--json\` flags or \`jq\` parsing
|
|
728
816
|
- **Fresh data**: Always current, not stale from file generation
|
|
729
817
|
- **Precise**: Only get the data you need
|
|
730
|
-
- **Token-efficient**: ~100 tokens per query vs ~2000
|
|
818
|
+
- **Token-efficient**: ~100-300 tokens per query vs ~2000 for file reads
|
|
819
|
+
- **No latency**: No process spawn \u2014 MCP tools respond directly
|
|
731
820
|
`;
|
|
732
821
|
}
|
|
733
822
|
/**
|
|
@@ -854,6 +943,97 @@ paradigm_session_stats()
|
|
|
854
943
|
\`\`\`
|
|
855
944
|
|
|
856
945
|
${generateCheckpointProtocol()}`;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Workflow protocol - the single most important compliance file.
|
|
949
|
+
* Contains session bookends, task-size guide, essential MCP tools, and non-negotiable rules.
|
|
950
|
+
*/
|
|
951
|
+
generateWorkflowMdc() {
|
|
952
|
+
return frontmatter("Paradigm workflow protocol - MUST follow for every task. Session bookends, task-size compliance, essential MCP tools.", {
|
|
953
|
+
alwaysApply: true
|
|
954
|
+
}) + `# Paradigm Workflow Protocol
|
|
955
|
+
|
|
956
|
+
**This file defines the non-negotiable workflow for every task. Follow it.**
|
|
957
|
+
|
|
958
|
+
## Session Bookends (MUST Do)
|
|
959
|
+
|
|
960
|
+
### Session Start
|
|
961
|
+
\`\`\`
|
|
962
|
+
paradigm_session_recover()
|
|
963
|
+
\`\`\`
|
|
964
|
+
Call this FIRST in every session. Returns previous context, modified symbols, and suggestions.
|
|
965
|
+
|
|
966
|
+
### Session End
|
|
967
|
+
\`\`\`
|
|
968
|
+
paradigm_pm_postflight({ summary: "what you did" })
|
|
969
|
+
\`\`\`
|
|
970
|
+
Call this LAST before finishing. Catches missing .purpose files, missing gates, and compliance gaps.
|
|
971
|
+
|
|
972
|
+
## Task-Size Compliance Guide
|
|
973
|
+
|
|
974
|
+
Not every task needs the full ceremony. Match your effort to the scope:
|
|
975
|
+
|
|
976
|
+
### Single-file bug fix (1 file changed)
|
|
977
|
+
1. Session bookends (start + end)
|
|
978
|
+
2. That's it \u2014 fix the bug, run postflight
|
|
979
|
+
|
|
980
|
+
### Multi-file fix (2-3 files changed)
|
|
981
|
+
1. Session bookends
|
|
982
|
+
2. \`paradigm_ripple({ symbol: "#affected-symbol" })\` before changing
|
|
983
|
+
3. Update nearest \`.purpose\` file if behavior changed
|
|
984
|
+
4. Postflight
|
|
985
|
+
|
|
986
|
+
### Feature build (3+ files, new behavior)
|
|
987
|
+
1. Session bookends
|
|
988
|
+
2. \`paradigm_pm_preflight({ task: "description" })\` \u2014 get compliance plan
|
|
989
|
+
3. \`paradigm_ripple\` for each symbol you'll modify
|
|
990
|
+
4. Implement the feature
|
|
991
|
+
5. Create/update \`.purpose\` files for new directories
|
|
992
|
+
6. Update \`portal.yaml\` if adding protected routes
|
|
993
|
+
7. \`paradigm_pm_postflight\` \u2014 verify compliance
|
|
994
|
+
8. \`paradigm_lore_record\` \u2014 record what you learned
|
|
995
|
+
|
|
996
|
+
## The One Non-Negotiable Rule
|
|
997
|
+
|
|
998
|
+
**You MUST update the nearest \`.purpose\` file when you change behavior.**
|
|
999
|
+
|
|
1000
|
+
- Adding a feature? Create a \`.purpose\` in the feature directory.
|
|
1001
|
+
- Modifying a component? Update its \`.purpose\` description, gates, or signals.
|
|
1002
|
+
- Deleting code? Remove the symbol from \`.purpose\`.
|
|
1003
|
+
- Not sure? Run \`paradigm_pm_postflight\` \u2014 it will tell you what's missing.
|
|
1004
|
+
|
|
1005
|
+
## Essential MCP Tools (Use These, NOT CLI Commands)
|
|
1006
|
+
|
|
1007
|
+
| Tool | When | Cost |
|
|
1008
|
+
|------|------|------|
|
|
1009
|
+
| \`paradigm_session_recover\` | Session start | ~100 tokens |
|
|
1010
|
+
| \`paradigm_ripple\` | Before modifying any symbol | ~300 tokens |
|
|
1011
|
+
| \`paradigm_navigate\` | Finding code locations | ~200 tokens |
|
|
1012
|
+
| \`paradigm_pm_preflight\` | Before starting a feature (3+ files) | ~200 tokens |
|
|
1013
|
+
| \`paradigm_pm_postflight\` | After finishing any task | ~200 tokens |
|
|
1014
|
+
| \`paradigm_reindex\` | After creating/modifying .purpose files | ~100 tokens |
|
|
1015
|
+
| \`paradigm_gates_for_route\` | Before adding API endpoints | ~150 tokens |
|
|
1016
|
+
| \`paradigm_lore_record\` | After completing a feature (record learnings) | ~100 tokens |
|
|
1017
|
+
|
|
1018
|
+
## Red Flags \u2014 STOP and Check
|
|
1019
|
+
|
|
1020
|
+
If you find yourself doing any of these, STOP:
|
|
1021
|
+
|
|
1022
|
+
- **Modifying 3+ files without calling \`paradigm_ripple\`** \u2192 Check impact first
|
|
1023
|
+
- **Adding routes without checking \`paradigm_gates_for_route\`** \u2192 Get gate suggestions
|
|
1024
|
+
- **Finishing without running \`paradigm_pm_postflight\`** \u2192 You'll miss compliance gaps
|
|
1025
|
+
- **Creating directories without a \`.purpose\` file** \u2192 Every directory needs context
|
|
1026
|
+
`;
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Practices - habits compliance, lore recording, llms.txt (Phase 5/6 content)
|
|
1030
|
+
*/
|
|
1031
|
+
generatePracticesMdc() {
|
|
1032
|
+
return frontmatter("Paradigm practices - habits, lore recording, and llms.txt. Apply when finishing tasks, recording history, or checking compliance.", {
|
|
1033
|
+
alwaysApply: false
|
|
1034
|
+
}) + `# Paradigm Practices
|
|
1035
|
+
|
|
1036
|
+
` + generateHabitsSection() + "\n\n" + generateLoreSection() + "\n\n" + generateLlmsTxtSection();
|
|
857
1037
|
}
|
|
858
1038
|
/**
|
|
859
1039
|
* Load agents manifest from .paradigm/agents.yaml
|
|
@@ -2033,6 +2213,10 @@ var AgentsAdapter = class {
|
|
|
2033
2213
|
sections.push(generateWorkflowProtocol());
|
|
2034
2214
|
sections.push(generateCommitConvention());
|
|
2035
2215
|
sections.push(generateHandoffProtocol());
|
|
2216
|
+
sections.push(generateCheckpointProtocol());
|
|
2217
|
+
sections.push(generateHabitsSection());
|
|
2218
|
+
sections.push(generateLoreSection());
|
|
2219
|
+
sections.push(generateLlmsTxtSection());
|
|
2036
2220
|
const updateSection = generateUpdateRules(config);
|
|
2037
2221
|
if (updateSection) {
|
|
2038
2222
|
sections.push(updateSection);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
__require
|
|
4
|
+
} from "./chunk-MO4EEYFW.js";
|
|
2
5
|
|
|
3
6
|
// src/core/lore/storage.ts
|
|
4
7
|
import * as fs from "fs";
|
|
@@ -59,7 +62,67 @@ function applyLoreFilter(entries, filter) {
|
|
|
59
62
|
var LORE_DIR = ".paradigm/lore";
|
|
60
63
|
var ENTRIES_DIR = "entries";
|
|
61
64
|
var TIMELINE_FILE = "timeline.yaml";
|
|
62
|
-
|
|
65
|
+
function validateLoreSymbols(rootDir, symbols) {
|
|
66
|
+
const result = { unregistered: [], warnings: [] };
|
|
67
|
+
if (symbols.length === 0) return result;
|
|
68
|
+
const declaredSymbols = /* @__PURE__ */ new Set();
|
|
69
|
+
try {
|
|
70
|
+
const findResult = __require("child_process").execSync(
|
|
71
|
+
`find "${rootDir}" -name ".purpose" -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null || true`,
|
|
72
|
+
{ encoding: "utf-8" }
|
|
73
|
+
);
|
|
74
|
+
for (const purposePath of findResult.split("\n").filter(Boolean)) {
|
|
75
|
+
try {
|
|
76
|
+
const content = fs.readFileSync(purposePath, "utf8");
|
|
77
|
+
const symbolMatches = content.matchAll(/^([#$^!~][\w-]+):/gm);
|
|
78
|
+
for (const match of symbolMatches) {
|
|
79
|
+
declaredSymbols.add(match[1]);
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
} catch {
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
const flowsPath = path.join(rootDir, ".paradigm", "flows.yaml");
|
|
88
|
+
if (fs.existsSync(flowsPath)) {
|
|
89
|
+
try {
|
|
90
|
+
const content = fs.readFileSync(flowsPath, "utf8");
|
|
91
|
+
const symbolMatches = content.matchAll(/([#$^!~][\w-]+)/g);
|
|
92
|
+
for (const match of symbolMatches) {
|
|
93
|
+
declaredSymbols.add(match[1]);
|
|
94
|
+
}
|
|
95
|
+
} catch {
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const portalPath = path.join(rootDir, "portal.yaml");
|
|
99
|
+
if (fs.existsSync(portalPath)) {
|
|
100
|
+
try {
|
|
101
|
+
const content = fs.readFileSync(portalPath, "utf8");
|
|
102
|
+
const gateMatches = content.matchAll(/\^([\w-]+)/g);
|
|
103
|
+
for (const match of gateMatches) {
|
|
104
|
+
declaredSymbols.add(`^${match[1]}`);
|
|
105
|
+
}
|
|
106
|
+
} catch {
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
for (const symbol of symbols) {
|
|
110
|
+
if (!declaredSymbols.has(symbol)) {
|
|
111
|
+
result.unregistered.push(symbol);
|
|
112
|
+
result.warnings.push(`Symbol "${symbol}" not found in .purpose files or project index`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
async function recordLore(rootDir, entry, options) {
|
|
118
|
+
let validation;
|
|
119
|
+
if (options?.validateSymbols) {
|
|
120
|
+
const allSymbols = [
|
|
121
|
+
...entry.symbols_touched || [],
|
|
122
|
+
...entry.symbols_created || []
|
|
123
|
+
];
|
|
124
|
+
validation = validateLoreSymbols(rootDir, allSymbols);
|
|
125
|
+
}
|
|
63
126
|
const lorePath = path.join(rootDir, LORE_DIR);
|
|
64
127
|
const dateStr = entry.timestamp.slice(0, 10);
|
|
65
128
|
const datePath = path.join(lorePath, ENTRIES_DIR, dateStr);
|
|
@@ -72,6 +135,7 @@ async function recordLore(rootDir, entry) {
|
|
|
72
135
|
const entryPath = path.join(datePath, `${entry.id}.yaml`);
|
|
73
136
|
fs.writeFileSync(entryPath, yaml.dump(entry, { lineWidth: -1, noRefs: true }));
|
|
74
137
|
await rebuildTimeline(rootDir);
|
|
138
|
+
return { validation };
|
|
75
139
|
}
|
|
76
140
|
async function loadLoreEntries(rootDir, filter) {
|
|
77
141
|
const entriesPath = path.join(rootDir, LORE_DIR, ENTRIES_DIR);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
extractStates,
|
|
10
10
|
extractSymbolReferences,
|
|
11
11
|
getAllPurposeFiles
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MRENOFTR.js";
|
|
13
13
|
import {
|
|
14
14
|
findGateFiles,
|
|
15
15
|
parseGateConfig
|
|
@@ -330,7 +330,9 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
330
330
|
data: item,
|
|
331
331
|
description: item.description,
|
|
332
332
|
anchors: item.anchors?.map((a) => parseAnchorString(a)),
|
|
333
|
-
appliesTo: item["applies-to"]
|
|
333
|
+
appliesTo: item["applies-to"],
|
|
334
|
+
tags: item.tags,
|
|
335
|
+
enforcement: item.enforcement
|
|
334
336
|
}));
|
|
335
337
|
}
|
|
336
338
|
const symbolRefs = extractSymbolReferences(parsed);
|