gaslighting-engine 0.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.
Files changed (89) hide show
  1. package/.codex/prompts/gaslighting.md +30 -0
  2. package/.codex/skills/gaslighting/SKILL.md +96 -0
  3. package/.codex/skills/gaslighting/agents/openai.yaml +8 -0
  4. package/.codex/skills/gaslighting/references/GASLIGHTING_TEMPLATE.md +425 -0
  5. package/.codex/skills/gaslighting/references/HARDCORE_DISCIPLINE_TEMPLATE.md +425 -0
  6. package/.codex/skills/gaslighting/references/HOSPITAL_HOMEPAGE_EXAMPLE.md +119 -0
  7. package/.codex/skills/gaslighting/references/STACK_POLICY_TEMPLATE.md +64 -0
  8. package/.codex/skills/gaslighting/scripts/generate-gaslighting-docs.ts +3 -0
  9. package/LICENSE +21 -0
  10. package/README.md +200 -0
  11. package/dist/cli.js +118 -0
  12. package/dist/commands/agents.js +10 -0
  13. package/dist/commands/codexInstall.js +60 -0
  14. package/dist/commands/doctor.js +42 -0
  15. package/dist/commands/generate.js +4 -0
  16. package/dist/commands/init.js +27 -0
  17. package/dist/commands/skill.js +10 -0
  18. package/dist/commands/update.js +35 -0
  19. package/dist/core/analyze.js +132 -0
  20. package/dist/core/classifyProjectType.js +66 -0
  21. package/dist/core/content.js +125 -0
  22. package/dist/core/detectStackHints.js +34 -0
  23. package/dist/core/generateDocs.js +58 -0
  24. package/dist/core/generateGaslightingMarkdown.js +420 -0
  25. package/dist/core/generateOtherMarkdown.js +529 -0
  26. package/dist/core/generatePrdMarkdown.js +125 -0
  27. package/dist/index.js +3 -0
  28. package/dist/types.js +1 -0
  29. package/dist/utils/banner.js +49 -0
  30. package/dist/utils/date.js +6 -0
  31. package/dist/utils/file.js +24 -0
  32. package/dist/utils/logger.js +27 -0
  33. package/dist/utils/markdown.js +6 -0
  34. package/docs/codex-usage.md +58 -0
  35. package/docs/examples.md +22 -0
  36. package/docs/philosophy.md +17 -0
  37. package/docs/research.md +54 -0
  38. package/examples/ecommerce/.codex/prompts/gaslighting.md +30 -0
  39. package/examples/ecommerce/.codex/skills/gaslighting/SKILL.md +96 -0
  40. package/examples/ecommerce/.codex/skills/gaslighting/agents/openai.yaml +8 -0
  41. package/examples/ecommerce/.codex/skills/gaslighting/references/GASLIGHTING_TEMPLATE.md +425 -0
  42. package/examples/ecommerce/.codex/skills/gaslighting/references/HARDCORE_DISCIPLINE_TEMPLATE.md +425 -0
  43. package/examples/ecommerce/.codex/skills/gaslighting/references/HOSPITAL_HOMEPAGE_EXAMPLE.md +119 -0
  44. package/examples/ecommerce/.codex/skills/gaslighting/references/STACK_POLICY_TEMPLATE.md +64 -0
  45. package/examples/ecommerce/.codex/skills/gaslighting/scripts/generate-gaslighting-docs.ts +3 -0
  46. package/examples/ecommerce/AGENTS.md +47 -0
  47. package/examples/ecommerce/ASSUMPTIONS.md +146 -0
  48. package/examples/ecommerce/CODEX_PROMPT.md +34 -0
  49. package/examples/ecommerce/DECISION_LOG.md +95 -0
  50. package/examples/ecommerce/GASLIGHTING.md +429 -0
  51. package/examples/ecommerce/MEMORY.md +63 -0
  52. package/examples/ecommerce/MISSING_INFO.md +13 -0
  53. package/examples/ecommerce/PRD.md +115 -0
  54. package/examples/ecommerce/STACK_POLICY.md +64 -0
  55. package/examples/hospital-homepage/.codex/prompts/gaslighting.md +30 -0
  56. package/examples/hospital-homepage/.codex/skills/gaslighting/SKILL.md +96 -0
  57. package/examples/hospital-homepage/.codex/skills/gaslighting/agents/openai.yaml +8 -0
  58. package/examples/hospital-homepage/.codex/skills/gaslighting/references/GASLIGHTING_TEMPLATE.md +425 -0
  59. package/examples/hospital-homepage/.codex/skills/gaslighting/references/HARDCORE_DISCIPLINE_TEMPLATE.md +425 -0
  60. package/examples/hospital-homepage/.codex/skills/gaslighting/references/HOSPITAL_HOMEPAGE_EXAMPLE.md +119 -0
  61. package/examples/hospital-homepage/.codex/skills/gaslighting/references/STACK_POLICY_TEMPLATE.md +64 -0
  62. package/examples/hospital-homepage/.codex/skills/gaslighting/scripts/generate-gaslighting-docs.ts +3 -0
  63. package/examples/hospital-homepage/AGENTS.md +47 -0
  64. package/examples/hospital-homepage/ASSUMPTIONS.md +218 -0
  65. package/examples/hospital-homepage/CODEX_PROMPT.md +34 -0
  66. package/examples/hospital-homepage/DECISION_LOG.md +95 -0
  67. package/examples/hospital-homepage/GASLIGHTING.md +432 -0
  68. package/examples/hospital-homepage/MEMORY.md +66 -0
  69. package/examples/hospital-homepage/MISSING_INFO.md +13 -0
  70. package/examples/hospital-homepage/PRD.md +119 -0
  71. package/examples/hospital-homepage/STACK_POLICY.md +64 -0
  72. package/examples/landing-page/.codex/prompts/gaslighting.md +30 -0
  73. package/examples/landing-page/.codex/skills/gaslighting/SKILL.md +96 -0
  74. package/examples/landing-page/.codex/skills/gaslighting/agents/openai.yaml +8 -0
  75. package/examples/landing-page/.codex/skills/gaslighting/references/GASLIGHTING_TEMPLATE.md +425 -0
  76. package/examples/landing-page/.codex/skills/gaslighting/references/HARDCORE_DISCIPLINE_TEMPLATE.md +425 -0
  77. package/examples/landing-page/.codex/skills/gaslighting/references/HOSPITAL_HOMEPAGE_EXAMPLE.md +119 -0
  78. package/examples/landing-page/.codex/skills/gaslighting/references/STACK_POLICY_TEMPLATE.md +64 -0
  79. package/examples/landing-page/.codex/skills/gaslighting/scripts/generate-gaslighting-docs.ts +3 -0
  80. package/examples/landing-page/AGENTS.md +47 -0
  81. package/examples/landing-page/ASSUMPTIONS.md +146 -0
  82. package/examples/landing-page/CODEX_PROMPT.md +34 -0
  83. package/examples/landing-page/DECISION_LOG.md +95 -0
  84. package/examples/landing-page/GASLIGHTING.md +424 -0
  85. package/examples/landing-page/MEMORY.md +63 -0
  86. package/examples/landing-page/MISSING_INFO.md +13 -0
  87. package/examples/landing-page/PRD.md +103 -0
  88. package/examples/landing-page/STACK_POLICY.md +64 -0
  89. package/package.json +37 -0
@@ -0,0 +1,63 @@
1
+ # MEMORY.md
2
+
3
+ This is the local project memory for Gaslighting-engine.
4
+
5
+ It is inspired by agent memory systems, but it is not a vague diary.
6
+
7
+ It records stable project facts, recurring workflow rules, known failure patterns, and decisions that future AI-agent sessions must not forget.
8
+
9
+ Keep required rules in `AGENTS.md`, `GASLIGHTING.md`, and checked-in documents. Treat this file as a compact recall layer, not the only source of truth.
10
+
11
+ ## Stable Project Facts
12
+
13
+ - Original request: Build an ecommerce MVP with product catalog, cart, checkout, and admin orders.
14
+ - Project type: ecommerce
15
+ - Classification confidence: high
16
+ - Stack hints: none
17
+
18
+ ## Working Preferences
19
+
20
+ - Prefer the shortest useful command: `gaslighting "project request"`.
21
+ - Default discipline mode is hardcore.
22
+ - Full-scope enforcement is default.
23
+ - No-TODO escape prevention is default.
24
+ - No-shortcut enforcement is default.
25
+ - Missing information should be assumed, documented, and carried forward unless truly blocking.
26
+
27
+ ## Known Agent Failure Patterns
28
+
29
+ - Summarizing remaining work instead of doing it.
30
+ - Treating representative examples as full implementation.
31
+ - Using TODO comments as a substitute for requested work.
32
+ - Creating placeholders and calling them structure.
33
+ - Forgetting the project purpose after the first implementation pass.
34
+ - Over-engineering instead of delivering the concrete MVP.
35
+
36
+ ## Hades-Style Audit Rules
37
+
38
+ These are cleanup and verification rules:
39
+
40
+ - Zero fake completion.
41
+ - Zero TODO escape.
42
+ - Zero dead placeholder files pretending to be implementation.
43
+ - Zero unexplained scope reductions.
44
+ - Zero unverified success claims.
45
+ - Every destructive cleanup must be intentional and explainable.
46
+ - If code or files are removed, record why in `DECISION_LOG.md`.
47
+
48
+ ## Memory Write Rules
49
+
50
+ Add to this file only when a fact is stable and useful across future sessions.
51
+
52
+ Do not store secrets, API keys, credentials, private tokens, or sensitive personal data.
53
+
54
+ When a memory becomes wrong, do not silently delete it. Mark it outdated and append the corrected fact.
55
+
56
+ ## Current Assumptions To Remember
57
+
58
+ - Store name: Sample Store.
59
+ - MVP requires product discovery, cart, checkout preparation, order creation, and admin product/order operations.
60
+ - Payment provider is a production decision; Stripe or Toss Payments should be selected based on market.
61
+ - Use the default practical web stack unless the user later specifies otherwise.
62
+ - Build an MVP that can be implemented locally without a SaaS backend for this generator.
63
+ - Treat unspecified brand/content details as temporary copy that must be human-reviewed before production.
@@ -0,0 +1,13 @@
1
+ # MISSING_INFO.md
2
+
3
+ Missing information must be classified honestly.
4
+
5
+ Most missing information is not blocking.
6
+
7
+ If information is missing but implementation can proceed with a practical assumption, document it and continue.
8
+
9
+ | Item | Current Status | Temporary Assumption | Impact | Blocking? | Recommended Action |
10
+ |---|---|---|---|---|---|
11
+ | Product catalog, payment market, and fulfillment rules | Missing but non-blocking | Use sample products and a payment-ready checkout architecture. | high | blocking before production | Provide real SKU data, shipping policy, tax rules, payment provider, and refund policy. |
12
+ | Final brand identity and production copy | Missing but non-blocking | Use clear temporary copy and document it as replaceable. | medium | blocking before production | Collect final brand name, tone, assets, and legally approved copy before launch. |
13
+ | Exact deployment credentials and accounts | Missing but non-blocking | Prepare the app for Vercel-style deployment without requiring credentials during implementation. | medium | blocking before production | Add project-specific env vars and provider accounts before production deployment. |
@@ -0,0 +1,115 @@
1
+ # PRD.md
2
+
3
+ ## 1. Product Overview
4
+
5
+ Build an MVP for this request:
6
+
7
+ > Build an ecommerce MVP with product catalog, cart, checkout, and admin orders.
8
+
9
+ Classified project type: `ecommerce`
10
+
11
+ The product must preserve the user's actual scope and must not become a decorative shell.
12
+
13
+ ## 2. Business Purpose
14
+
15
+ - product discovery
16
+ - product detail clarity
17
+ - cart flow
18
+ - checkout flow
19
+ - order creation
20
+ - payment readiness
21
+ - admin product management
22
+ - mobile purchase experience
23
+
24
+ ## 3. Target Users
25
+
26
+ - Shoppers browsing products
27
+ - Returning customers checking orders
28
+ - Store operators managing products and orders
29
+
30
+ ## 4. User Flows
31
+
32
+ - Browse products -> view detail -> add to cart -> checkout -> order complete
33
+ - Admin -> create/edit product -> review orders
34
+
35
+ ## 5. Page List
36
+
37
+ - Home
38
+ - Product List
39
+ - Product Detail
40
+ - Cart
41
+ - Checkout
42
+ - Order Complete
43
+ - My Orders
44
+ - Admin Products
45
+ - Admin Orders
46
+
47
+ ## 6. Feature List
48
+
49
+ - product listing
50
+ - product detail page
51
+ - cart
52
+ - checkout preparation
53
+ - order creation
54
+ - product image support
55
+ - admin product CRUD
56
+ - admin order view
57
+ - responsive UI
58
+
59
+ ## 7. Data Model Draft
60
+
61
+ - Product: title, slug, description, price, images, stockStatus
62
+ - CartItem: productId, quantity, priceSnapshot
63
+ - Order: customer, items, total, status, createdAt
64
+ - AdminUser: email, role
65
+
66
+ ## 8. MVP Scope
67
+
68
+ - Implement all pages, flows, and features listed above.
69
+ - Include responsive behavior.
70
+ - Include useful empty, loading, success, and error states where applicable.
71
+ - Include SEO metadata where public pages exist.
72
+ - Include analytics-ready structure where conversion matters.
73
+ - Document every assumption that affects implementation.
74
+
75
+ ## 9. Out of Scope
76
+
77
+ - warehouse automation
78
+ - multi-vendor marketplace
79
+ - subscription billing unless requested
80
+ - complex ERP integration
81
+
82
+ ## 10. Non-Functional Requirements
83
+
84
+ - Mobile-first where users are likely to arrive from search or ads.
85
+ - Accessible semantic HTML.
86
+ - Fast initial load for public pages.
87
+ - Safe form validation and clear error messages.
88
+ - Maintainable TypeScript structure.
89
+ - No unnecessary distributed systems.
90
+
91
+ ## 11. Tech Stack
92
+
93
+ No stack hints were provided. Use the default practical web stack unless the user later changes it.
94
+
95
+ See `STACK_POLICY.md` for defaults and forbidden-by-default technology.
96
+
97
+ ## 12. Risks
98
+
99
+ - Vague source requirements can cause wrong vertical assumptions.
100
+ - Placeholder copy can look real if not reviewed.
101
+ - Missing production credentials can block deployment.
102
+ - AI agents may reduce scope unless `GASLIGHTING.md` is enforced.
103
+
104
+ ## 13. Missing Information
105
+
106
+ See `MISSING_INFO.md`.
107
+
108
+ ## 14. Success Criteria
109
+
110
+ - The project purpose is visible in the implemented product.
111
+ - The core pages and features are implemented, not merely described.
112
+ - No required scope is replaced by representative examples.
113
+ - No TODO is used as a substitute for implementation.
114
+ - Assumptions and decisions remain documented.
115
+ - The output can actually be used for the MVP purpose.
@@ -0,0 +1,64 @@
1
+ # STACK_POLICY.md
2
+
3
+ ## Detected Stack Hints
4
+
5
+ - No stack hints detected.
6
+
7
+ If detected stack hints conflict with the project purpose, the project purpose wins.
8
+
9
+ ## Default Web Stack
10
+
11
+ - Framework: Next.js latest stable version
12
+ - Language: TypeScript
13
+ - Styling: Tailwind CSS
14
+ - UI: shadcn/ui
15
+ - Database: PostgreSQL
16
+ - DB Provider: NeonDB first, Supabase alternative
17
+ - Hosting: Vercel
18
+ - File Storage: Vercel Blob or Cloudflare R2
19
+ - Analytics: GA4 + Google Tag Manager
20
+ - Email: Resend or equivalent
21
+ - ORM: Prisma or Drizzle
22
+
23
+ ## Stack Selection Rules
24
+
25
+ ### Choose NeonDB when
26
+
27
+ - The project needs PostgreSQL.
28
+ - The project is deployed on Vercel.
29
+ - Serverless-friendly PostgreSQL is useful.
30
+ - A clean MVP database is enough.
31
+
32
+ ### Choose Supabase when
33
+
34
+ - Auth, DB, and storage should be bundled.
35
+ - Admin/user accounts are likely.
36
+ - The project benefits from Supabase dashboard operations.
37
+ - Storage and database need to live together.
38
+
39
+ ### Choose Vercel Blob when
40
+
41
+ - The project is Vercel-centered.
42
+ - File uploads are simple.
43
+ - Operational simplicity matters.
44
+
45
+ ### Choose Cloudflare R2 when
46
+
47
+ - Storage volume may grow.
48
+ - CDN/cost strategy matters.
49
+ - Cloudflare DNS/cache is already part of the plan.
50
+
51
+ ## Forbidden by Default
52
+
53
+ Do not introduce the following unless explicitly required:
54
+
55
+ - Kubernetes
56
+ - Kafka
57
+ - RabbitMQ
58
+ - Microservices
59
+ - GraphQL Federation
60
+ - Redis Cluster
61
+ - Terraform-heavy infrastructure
62
+ - Event sourcing
63
+ - Multi-region deployment
64
+ - Complex distributed systems
@@ -0,0 +1,30 @@
1
+ # /gaslighting
2
+
3
+ Read the Gaslighting-engine project-control files before doing any work:
4
+
5
+ 1. `GASLIGHTING.md`
6
+ 2. `PRD.md`
7
+ 3. `STACK_POLICY.md`
8
+ 4. `MISSING_INFO.md`
9
+ 5. `ASSUMPTIONS.md`
10
+ 6. `DECISION_LOG.md`
11
+ 7. `AGENTS.md`
12
+ 8. `MEMORY.md`
13
+
14
+ Then execute the user's requested implementation.
15
+
16
+ Rules:
17
+
18
+ - Preserve the full requested scope.
19
+ - Make reasonable assumptions and document them.
20
+ - Do not use TODO comments as fake implementation.
21
+ - Do not implement only representative examples.
22
+ - Do not say "the rest follows the same pattern."
23
+ - Do not call scaffolding completion.
24
+ - Do not call placeholders implementation.
25
+ - Do not over-engineer.
26
+ - Record stable project facts in `MEMORY.md`.
27
+ - Record product and technical decisions in `DECISION_LOG.md`.
28
+ - If something is incomplete, declare it explicitly.
29
+
30
+ Before claiming completion, perform the self-audit in `GASLIGHTING.md`.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: gaslighting
3
+ description: Generate or update strict project discipline documents for Codex and AI coding agents. Use when a user asks to initialize Gaslighting, create GASLIGHTING.md/PRD.md/AGENTS.md discipline files, preserve full project scope, prevent TODO escape, prevent fake completion, or turn vague project intent into actionable control documents.
4
+ ---
5
+
6
+ # Gaslighting-engine Skill
7
+
8
+ You are a project-discipline generator for AI coding agents.
9
+
10
+ When a user gives a vague project request, do not stop and ask a long list of questions.
11
+
12
+ Instead:
13
+
14
+ 1. Infer the project type.
15
+ 2. Identify the project's core purpose.
16
+ 3. Make reasonable assumptions.
17
+ 4. Document assumptions clearly.
18
+ 5. Mark missing information clearly.
19
+ 6. Generate `GASLIGHTING.md`.
20
+ 7. Generate `PRD.md`.
21
+ 8. Generate `ASSUMPTIONS.md`.
22
+ 9. Generate `MISSING_INFO.md`.
23
+ 10. Generate `DECISION_LOG.md`.
24
+ 11. Generate `STACK_POLICY.md`.
25
+ 12. Generate or update `AGENTS.md`.
26
+
27
+ ## Hardcore Discipline Rule
28
+
29
+ The generated documents must prevent escape behavior.
30
+
31
+ Explicitly forbid:
32
+
33
+ - implementing only representative examples
34
+ - leaving TODOs instead of implementation
35
+ - saying "the rest can be done similarly"
36
+ - silently reducing requested scope
37
+ - pretending the task is complete
38
+ - replacing implementation with explanation
39
+ - creating empty placeholders
40
+ - skipping repetitive items because they are repetitive
41
+ - treating structure as completion
42
+ - treating direction as delivery
43
+
44
+ The agent must either:
45
+
46
+ 1. complete the full requested scope, or
47
+ 2. clearly declare what is incomplete.
48
+
49
+ Never allow fake completion.
50
+
51
+ Never allow scope shrinkage.
52
+
53
+ Never allow TODO-based escape.
54
+
55
+ ## Missing Information Rule
56
+
57
+ Missing information is not a free excuse to stop.
58
+
59
+ Classify missing information as:
60
+
61
+ - Confirmed
62
+ - Assumed
63
+ - Missing but non-blocking
64
+ - Missing and risky
65
+ - Missing and blocking
66
+
67
+ Only truly blocking information may stop implementation.
68
+
69
+ ## Default Tech Policy
70
+
71
+ For web projects, prefer:
72
+
73
+ - Next.js
74
+ - TypeScript
75
+ - Tailwind CSS
76
+ - shadcn/ui
77
+ - PostgreSQL
78
+ - NeonDB or Supabase
79
+ - Vercel
80
+ - Vercel Blob or Cloudflare R2
81
+ - GA4 + Google Tag Manager when analytics are needed
82
+ - Resend or equivalent when email is needed
83
+
84
+ Avoid over-engineering.
85
+
86
+ ## Output Rule
87
+
88
+ Create real markdown files.
89
+
90
+ Do not only explain.
91
+
92
+ Do not produce a plan without files.
93
+
94
+ Do not say what should be done.
95
+
96
+ Generate the actual project discipline documents.
@@ -0,0 +1,8 @@
1
+ interface:
2
+ display_name: "Gaslighting-engine"
3
+ short_description: "Generate strict Codex project discipline docs"
4
+ brand_color: "#111827"
5
+ default_prompt: "Use $gaslighting to generate Gaslighting-engine discipline documents before implementation."
6
+
7
+ policy:
8
+ allow_implicit_invocation: true