@istmx/skills 1.0.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/README.md +49 -0
- package/bin/cli.js +251 -0
- package/istm/SKILL.md +65 -0
- package/istm-animate/SKILL.md +87 -0
- package/istm-animate/animations/animation_utils.md +280 -0
- package/istm-animate/animations/animations.md +220 -0
- package/istm-animate/animations/core_motion.md +250 -0
- package/istm-animate/animations/examples/README.md +29 -0
- package/istm-animate/animations/examples/nuxt/app/app.vue +3 -0
- package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +91 -0
- package/istm-animate/animations/examples/nuxt/app/pages/index.vue +55 -0
- package/istm-animate/animations/examples/nuxt/nuxt.config.ts +4 -0
- package/istm-animate/animations/examples/nuxt/package.json +18 -0
- package/istm-animate/animations/examples/react/App.jsx +46 -0
- package/istm-animate/animations/examples/react/index.html +12 -0
- package/istm-animate/animations/examples/react/main.jsx +9 -0
- package/istm-animate/animations/examples/react/package.json +21 -0
- package/istm-animate/animations/examples/react/vite.config.js +7 -0
- package/istm-animate/animations/examples/vanilla/index.html +33 -0
- package/istm-animate/animations/examples/vanilla/main.js +36 -0
- package/istm-animate/animations/examples/vue/app.vue +47 -0
- package/istm-animate/animations/examples/vue/index.html +15 -0
- package/istm-animate/animations/examples/vue/main.js +9 -0
- package/istm-animate/animations/examples/vue/package.json +19 -0
- package/istm-animate/animations/examples/vue/vite.config.js +7 -0
- package/istm-animate/animations/framework_motion.md +262 -0
- package/istm-animate/animations/motion.csv +17 -0
- package/istm-animate/animations/motion.md +11 -0
- package/istm-animate/animations/motion_catalog.json +226 -0
- package/istm-animate/animations/motion_performance.md +75 -0
- package/istm-animate/animations/motion_plugins.md +429 -0
- package/istm-animate/animations/react_animations.md +132 -0
- package/istm-animate/animations/scroll_trigger_effects.md +291 -0
- package/istm-animate/animations/timeline_sequencing.md +103 -0
- package/istm-architecture/SKILL.md +109 -0
- package/istm-architecture/frameworks/angular.csv +51 -0
- package/istm-architecture/frameworks/astro.csv +54 -0
- package/istm-architecture/frameworks/avalonia.csv +57 -0
- package/istm-architecture/frameworks/flutter.csv +53 -0
- package/istm-architecture/frameworks/javafx.csv +76 -0
- package/istm-architecture/frameworks/jetpack-compose.csv +53 -0
- package/istm-architecture/frameworks/laravel.csv +51 -0
- package/istm-architecture/frameworks/nextjs.csv +53 -0
- package/istm-architecture/frameworks/nuxtjs.csv +59 -0
- package/istm-architecture/frameworks/react-native.csv +52 -0
- package/istm-architecture/frameworks/react.csv +54 -0
- package/istm-architecture/frameworks/svelte.csv +54 -0
- package/istm-architecture/frameworks/swiftui.csv +51 -0
- package/istm-architecture/frameworks/uwp.csv +56 -0
- package/istm-architecture/frameworks/vue.csv +50 -0
- package/istm-architecture/frameworks/winui.csv +60 -0
- package/istm-architecture/frameworks/wpf.csv +57 -0
- package/istm-architecture/templates/agents.md +229 -0
- package/istm-architecture/templates/architecture.md +111 -0
- package/istm-architecture/templates/design.md +138 -0
- package/istm-architecture/templates/project-overview.md +215 -0
- package/istm-awwward-designer/SKILL.md +43 -0
- package/istm-awwward-designer/libraries/threejs.csv +54 -0
- package/istm-awwward-designer/references/accessibility.md +774 -0
- package/istm-awwward-designer/references/anim-anti-patterns.md +576 -0
- package/istm-awwward-designer/references/animation-map.md +166 -0
- package/istm-awwward-designer/references/animation-standards.md +86 -0
- package/istm-awwward-designer/references/anti-patterns.md +191 -0
- package/istm-awwward-designer/references/color-systems.md +604 -0
- package/istm-awwward-designer/references/css-performance.md +477 -0
- package/istm-awwward-designer/references/descender-safety.md +490 -0
- package/istm-awwward-designer/references/design-audit.md +93 -0
- package/istm-awwward-designer/references/font-loading.md +378 -0
- package/istm-awwward-designer/references/image-optimization.md +440 -0
- package/istm-awwward-designer/references/invention-gate.md +356 -0
- package/istm-awwward-designer/references/micro-interactions.md +825 -0
- package/istm-awwward-designer/references/page-transitions.md +365 -0
- package/istm-awwward-designer/references/performance-standards.md +79 -0
- package/istm-awwward-designer/references/quality-gate.md +103 -0
- package/istm-awwward-designer/references/responsive-design.md +778 -0
- package/istm-awwward-designer/references/scoring-guide.md +201 -0
- package/istm-awwward-designer/references/scroll-patterns.md +668 -0
- package/istm-awwward-designer/references/stitch-brief.md +124 -0
- package/istm-awwward-designer/references/tech-stack.md +204 -0
- package/istm-awwward-designer/references/technical-audit.md +133 -0
- package/istm-awwward-designer/references/technique-families.md +293 -0
- package/istm-awwward-designer/references/testing.md +535 -0
- package/istm-awwward-designer/references/text-animation.md +585 -0
- package/istm-awwward-designer/references/typography.md +504 -0
- package/istm-awwward-designer/references/usability-audit.md +108 -0
- package/istm-awwward-designer/references/visual-standards.md +97 -0
- package/istm-design/SKILL.md +98 -0
- package/istm-design/colors/color_theory.md +293 -0
- package/istm-design/colors/colors.csv +193 -0
- package/istm-design/colors/colors_catalog.json +4034 -0
- package/istm-design/colors/palette.json +21 -0
- package/istm-design/styles/design_system.md +288 -0
- package/istm-design/styles/html-tailwind.csv +56 -0
- package/istm-design/styles/nuxt-ui.csv +71 -0
- package/istm-design/styles/product_design.md +55 -0
- package/istm-design/styles/shadcn.csv +61 -0
- package/istm-design/styles/style.md +12 -0
- package/istm-design/styles/styles.csv +85 -0
- package/istm-design/styles/styles_catalog.json +2018 -0
- package/istm-design/styles/ui-reasoning.csv +162 -0
- package/istm-design/styles/uno.csv +60 -0
- package/istm-design/typography/font_and_font.md +10 -0
- package/istm-design/typography/google-fonts.csv +1924 -0
- package/istm-design/typography/sans_serif_fonts.md +112 -0
- package/istm-design/typography/typography.csv +75 -0
- package/istm-design/typography/typography_catalog.json +964 -0
- package/istm-design/ux/app-interface.csv +31 -0
- package/istm-design/ux/charts.csv +26 -0
- package/istm-design/ux/icons.csv +106 -0
- package/istm-design/ux/landing.csv +35 -0
- package/istm-design/ux/products.csv +193 -0
- package/istm-design/ux/react-performance.csv +45 -0
- package/istm-design/ux/responsive_rules.md +62 -0
- package/istm-design/ux/storytelling.md +47 -0
- package/istm-design/ux/ux-guidelines.csv +100 -0
- package/istm-design/ux/ux_guidelines.json +1190 -0
- package/istm-system-design/SKILL.md +88 -0
- package/istm-system-design/principles/01-architecture-patterns.md +24 -0
- package/istm-system-design/principles/02-database-selection.md +32 -0
- package/istm-system-design/principles/03-api-design.md +25 -0
- package/istm-system-design/principles/04-authentication-security.md +23 -0
- package/istm-system-design/principles/05-caching-performance.md +21 -0
- package/istm-system-design/principles/06-asynchronous-processing.md +17 -0
- package/istm-system-design/principles/07-infrastructure-deployment.md +22 -0
- package/istm-system-design/principles/08-low-level-design.md +35 -0
- package/istm-system-design/principles/09-state-management.md +14 -0
- package/istm-system-design/principles/10-error-handling-and-logging.md +26 -0
- package/istm-system-design/principles/11-testing-strategy.md +18 -0
- package/istm-system-design/principles/12-seo-and-web-vitals.md +18 -0
- package/istm-system-design/stacks/SETUP.md +82 -0
- package/istm-system-design/stacks/STACK.md +67 -0
- package/istm-system-design/stacks/WORKFLOW.md +84 -0
- package/istm-system-design/templates/api-route.ts.template +32 -0
- package/istm-system-design/templates/migrations.md.template +30 -0
- package/istm-system-design/templates/schema.drizzle.ts.template +17 -0
- package/istm-system-design/templates/schema.prisma.template +28 -0
- package/istm-system-design/templates/trpc-router.ts.template +22 -0
- package/istm-system-design/templates/zod-validators.ts.template +14 -0
- package/istm-workflow/istm-audit/SKILL.md +108 -0
- package/istm-workflow/istm-audit/agent-prompt.md +393 -0
- package/istm-workflow/istm-audit/agents/openai.yaml +7 -0
- package/istm-workflow/istm-audit/modes/area.md +19 -0
- package/istm-workflow/istm-audit/modes/gapfill.md +12 -0
- package/istm-workflow/istm-audit/modes/greenfield.md +24 -0
- package/istm-workflow/istm-audit/modes/tool-skills.md +39 -0
- package/istm-workflow/istm-audit/modes/whole-repo.md +5 -0
- package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -0
- package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -0
- package/istm-workflow/istm-audit/patterns/functional.md +16 -0
- package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -0
- package/istm-workflow/istm-check/SKILL.md +52 -0
- package/istm-workflow/istm-check/agents/openai.yaml +7 -0
- package/istm-workflow/istm-check/modes/review.md +156 -0
- package/istm-workflow/istm-check/modes/verify.md +197 -0
- package/istm-workflow/istm-check/review-agent-prompt.md +57 -0
- package/istm-workflow/istm-check/review-guide.md +133 -0
- package/istm-workflow/istm-craft/SKILL.md +37 -0
- package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -0
- package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -0
- package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -0
- package/istm-workflow/istm-craft/agent-modes/feature.md +85 -0
- package/istm-workflow/istm-craft/agent-prompt.md +249 -0
- package/istm-workflow/istm-craft/agents/openai.yaml +7 -0
- package/istm-workflow/istm-craft/internal/after-subagent.md +90 -0
- package/istm-workflow/istm-craft/internal/design-conversation.md +140 -0
- package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -0
- package/istm-workflow/istm-craft/spec-template.md +278 -0
- package/istm-workflow/istm-debug/SKILL.md +102 -0
- package/istm-workflow/istm-debug/agents/openai.yaml +7 -0
- package/istm-workflow/istm-develop/SKILL.md +144 -0
- package/istm-workflow/istm-develop/agents/openai.yaml +7 -0
- package/istm-workflow/istm-develop/checklist.md +95 -0
- package/istm-workflow/istm-develop/flow/build.md +133 -0
- package/istm-workflow/istm-develop/flow/git.md +34 -0
- package/istm-workflow/istm-develop/logical-guide.md +99 -0
- package/istm-workflow/istm-develop/ui/existing.md +23 -0
- package/istm-workflow/istm-develop/ui/generate.md +131 -0
- package/istm-workflow/istm-develop/ui/image.md +41 -0
- package/istm-workflow/istm-develop/ui/implementation.md +281 -0
- package/istm-workflow/istm-develop/ui/mcp.md +11 -0
- package/istm-workflow/istm-develop/ui-guide.md +164 -0
- package/istm-workflow/istm-document/SKILL.md +123 -0
- package/istm-workflow/istm-document/agent-prompt.md +57 -0
- package/istm-workflow/istm-document/agents/openai.yaml +7 -0
- package/istm-workflow/istm-document/templates/changelog.md +54 -0
- package/istm-workflow/istm-document/templates/postmortem.md +58 -0
- package/istm-workflow/istm-document/templates/pr.md +43 -0
- package/istm-workflow/istm-document/templates/release-note.md +41 -0
- package/istm-workflow/istm-scope/SKILL.md +100 -0
- package/istm-workflow/istm-scope/agents/openai.yaml +7 -0
- package/istm-workflow/istm-scope/approaches/facade.md +33 -0
- package/istm-workflow/istm-scope/approaches/journey.md +31 -0
- package/istm-workflow/istm-scope/approaches/skateboard.md +33 -0
- package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -0
- package/istm-workflow/istm-scope/modes/add.md +14 -0
- package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -0
- package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -0
- package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -0
- package/istm-workflow/istm-scope/modes/plan.md +120 -0
- package/istm-workflow/istm-scope/modes/replan.md +13 -0
- package/istm-workflow/istm-scope/scope-template.md +148 -0
- package/istm-workflow/istm-sync/SKILL.md +166 -0
- package/istm-workflow/istm-sync/agent-prompt.md +211 -0
- package/istm-workflow/istm-sync/agents/openai.yaml +7 -0
- package/istm-workflow/istm-test/SKILL.md +233 -0
- package/istm-workflow/istm-test/agent-prompt.md +62 -0
- package/istm-workflow/istm-test/agents/openai.yaml +7 -0
- package/istm-workflow/istm-test/modes/setup.md +97 -0
- package/istm-workflow/istm-test/writing-guide.md +196 -0
- package/package.json +35 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Database Migration Workflow
|
|
2
|
+
|
|
3
|
+
This document outlines the strict protocol for evolving the `{DB_PROVIDER}` database safely.
|
|
4
|
+
|
|
5
|
+
## 1. Schema Changes
|
|
6
|
+
All schema mutations MUST occur in: `{SCHEMA_FILE_PATH}`
|
|
7
|
+
Do not manually execute DDL statements against the database.
|
|
8
|
+
|
|
9
|
+
## 2. Generating Migrations
|
|
10
|
+
When the schema is modified, run the following command to generate the migration file:
|
|
11
|
+
\`\`\`bash
|
|
12
|
+
{GENERATE_COMMAND}
|
|
13
|
+
\`\`\`
|
|
14
|
+
|
|
15
|
+
## 3. Applying Migrations
|
|
16
|
+
To apply the migration to your local/development database:
|
|
17
|
+
\`\`\`bash
|
|
18
|
+
{APPLY_COMMAND}
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
## 4. CI/CD Enforcement
|
|
22
|
+
- Migrations MUST be committed to version control.
|
|
23
|
+
- In production, migrations are applied via the CI/CD pipeline using `{PROD_APPLY_COMMAND}` before the new application code is deployed.
|
|
24
|
+
- Never run migrations manually against production.
|
|
25
|
+
|
|
26
|
+
## 5. Seed Data
|
|
27
|
+
If baseline data is required (e.g. default roles, admin users), maintain the seed script in `{SEED_FILE_PATH}` and run:
|
|
28
|
+
\`\`\`bash
|
|
29
|
+
{SEED_COMMAND}
|
|
30
|
+
\`\`\`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';
|
|
2
|
+
// {DRIZZLE_IMPORTS}
|
|
3
|
+
|
|
4
|
+
// This is a dynamic Drizzle schema template for @istmx/skills
|
|
5
|
+
// The orchestrator will inject domain-specific columns and relationships.
|
|
6
|
+
|
|
7
|
+
export const users = pgTable('users', {
|
|
8
|
+
id: uuid('id').primaryKey().defaultRandom(),
|
|
9
|
+
email: text('email').notNull().unique(),
|
|
10
|
+
name: text('name'),
|
|
11
|
+
createdAt: timestamp('created_at').defaultNow().notNull(),
|
|
12
|
+
updatedAt: timestamp('updated_at').defaultNow().notNull(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// {ADDITIONAL_TABLES}
|
|
16
|
+
|
|
17
|
+
// {RELATIONS_DEFINITION}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// This is a dynamic Prisma schema template for @istmx/skills
|
|
2
|
+
// The orchestrator will inject the specific database provider and connection URLs.
|
|
3
|
+
|
|
4
|
+
generator client {
|
|
5
|
+
provider = "prisma-client-js"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
datasource db {
|
|
9
|
+
provider = "{DB_PROVIDER}" // e.g., "postgresql", "mysql", "sqlite"
|
|
10
|
+
url = env("DATABASE_URL")
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// -----------------------------------------------------------------------------
|
|
14
|
+
// CORE DOMAIN MODELS
|
|
15
|
+
// -----------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
model User {
|
|
18
|
+
id String @id @default(cuid())
|
|
19
|
+
email String @unique
|
|
20
|
+
name String?
|
|
21
|
+
createdAt DateTime @default(now())
|
|
22
|
+
updatedAt DateTime @updatedAt
|
|
23
|
+
|
|
24
|
+
// Relationships
|
|
25
|
+
// {USER_RELATIONSHIPS}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// {ADDITIONAL_MODELS}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// import { z } from 'zod';
|
|
2
|
+
// import { router, publicProcedure, protectedProcedure } from '{TRPC_CONFIG_PATH}';
|
|
3
|
+
// import { CreateUserSchema } from '{SCHEMA_IMPORT_PATH}';
|
|
4
|
+
|
|
5
|
+
export const {ROUTER_NAME}Router = router({
|
|
6
|
+
|
|
7
|
+
// Example Query
|
|
8
|
+
getAll: publicProcedure.query(async ({ ctx }) => {
|
|
9
|
+
// return ctx.db.user.findMany();
|
|
10
|
+
return [];
|
|
11
|
+
}),
|
|
12
|
+
|
|
13
|
+
// Example Mutation with Zod Validation
|
|
14
|
+
create: protectedProcedure
|
|
15
|
+
.input(/* CreateUserSchema */)
|
|
16
|
+
.mutation(async ({ ctx, input }) => {
|
|
17
|
+
// return ctx.db.user.create({ data: input });
|
|
18
|
+
return { success: true };
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
// {ADDITIONAL_PROCEDURES}
|
|
22
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// This is a dynamic Zod validation template for @istmx/skills
|
|
4
|
+
// Validates incoming API payloads to ensure end-to-end type safety.
|
|
5
|
+
|
|
6
|
+
export const CreateUserSchema = z.object({
|
|
7
|
+
email: z.string().email("Invalid email address"),
|
|
8
|
+
name: z.string().min(2, "Name must be at least 2 characters").optional(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// {ADDITIONAL_SCHEMAS}
|
|
12
|
+
|
|
13
|
+
export type CreateUserInput = z.infer<typeof CreateUserSchema>;
|
|
14
|
+
// {ADDITIONAL_TYPES}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit
|
|
3
|
+
allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent, AskUserQuestion
|
|
4
|
+
description: "Run /audit on a greenfield project, an existing codebase with missing docs, or one area (/audit src/auth) to bootstrap the project's AI context, the .istm-context/agents.md files every later skill reads. Writes tool agnostic .istm-context/agents.md plus thin CLAUDE.md pointers, adding only what is missing; never overwrites curated content."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Output style (plain words, no dashes, no hyphens)
|
|
8
|
+
|
|
9
|
+
<!-- OUTPUT-STYLE:START -->
|
|
10
|
+
Write everything this skill produces, files and messages alike, in plain simple language. Keep technical terms that carry real meaning; explain each in plain words. Never use a dash or a hyphen as punctuation: no em dash, no en dash, and no hyphenated compounds. Write `read only`, not `read-only`. Say it in simple words, or reword the sentence. Code, file paths, command flags, and values other skills match on keep their hyphens. Use short sentences, commas, or parentheses. Clear beats clever.
|
|
11
|
+
<!-- OUTPUT-STYLE:END -->
|
|
12
|
+
|
|
13
|
+
## What this skill does
|
|
14
|
+
|
|
15
|
+
The context bootstrapper: writes the `.istm-context/agents.md` files every later skill and AI tool reads.
|
|
16
|
+
|
|
17
|
+
- Greenfield (no code yet): ask for coding standards, seed root `.istm-context/agents.md` from the answers plus the build approach (name and one line principle) from the scope header if `/scope` set one. Runs after the project is scaffolded with its chosen stack (`/scope` → `/architect` decides the stack → scaffold → `/audit`); earlier is premature.
|
|
18
|
+
- Brownfield, undocumented (code, no `.istm-context/agents.md`): scan the whole project, write root `.istm-context/agents.md` and nested `<area>/.istm-context/agents.md` files, judging what is global (root) vs area specific (nested).
|
|
19
|
+
- Brownfield, partially documented: check existing root and nested docs against the whole codebase; add only what is missing (new global facts, nested docs for undocumented areas); never clobber curated content.
|
|
20
|
+
|
|
21
|
+
Does not create specs (/architect owns those), maintain files after changes (/sync owns that), or write the feature scope (/scope owns `.istm-context/scope/`).
|
|
22
|
+
|
|
23
|
+
## Context file convention (.istm-context/agents.md is canonical)
|
|
24
|
+
|
|
25
|
+
Durable context lives in the tool agnostic `.istm-context/agents.md` (root and nested); every agent (Codex, Cursor, Claude Code, and others) reads it. `CLAUDE.md` is only a one line pointer whose entire body imports the sibling `.istm-context/agents.md` via Claude Code's `@` import (exact pointer body in `agent-prompt.md`); content is never duplicated across the two.
|
|
26
|
+
|
|
27
|
+
- Write knowledge into `.istm-context/agents.md`. Create it when missing. Never overwrite an existing `.istm-context/agents.md` (it may be user or tool authored); gap fill conservatively, with permission.
|
|
28
|
+
- Migrate legacy content: a `CLAUDE.md` with content but no `.istm-context/agents.md` → ask permission, move its content into a new `.istm-context/agents.md`, replace `CLAUDE.md` with the pointer. Never silently discard curated content.
|
|
29
|
+
- Root stays short and global; nested `.istm-context/agents.md` only for meaningful areas with real conventions (same root/nested rules as previously applied to `CLAUDE.md`).
|
|
30
|
+
|
|
31
|
+
## Scope
|
|
32
|
+
|
|
33
|
+
An area path argument (e.g. `auth`, `src/payments`) triggers Phase 3. With no argument, the `Pre-flight` signals below route to Phase 0 (ambiguous: ask new vs existing), Phase 1 (greenfield: ask standards, seed root), Phase 2 (established, no root .istm-context/agents.md: whole-repo scan), or Phase 4 (root .istm-context/agents.md exists: gap-fill). A legacy `CLAUDE.md` with content but no `.istm-context/agents.md` is migrated, then treated as Phase 4.
|
|
34
|
+
|
|
35
|
+
## Acts vs asks
|
|
36
|
+
|
|
37
|
+
Phase 1 asks coding standards questions via MCQ before creating root .istm-context/agents.md. Phase 2 acts immediately, no questions; it writes root and the nested docs it judges warranted. Phases 3 and 4 act to explore but ask permission before modifying an existing root .istm-context/agents.md or migrating a legacy CLAUDE.md; Phase 4 reports nested doc creation for undocumented areas first, then applies on confirmation.
|
|
38
|
+
|
|
39
|
+
## Artifact ownership
|
|
40
|
+
|
|
41
|
+
The `.istm-context/agents.md` files hold the content: create root if missing (Phase 1, 2) and `<area>/.istm-context/agents.md` if missing and warranted, by judgment (Phase 2, 3, 4); when one exists, gap-fill or propose additions with permission; never overwrite. The `CLAUDE.md` files are pointers only (root and area), created if missing; a legacy one with content is migrated into `.istm-context/agents.md` with permission. When creating a nested `.istm-context/agents.md`, add exactly one pointer line to root `.istm-context/agents.md` under `## Context files`: `- [<area>/.istm-context/agents.md](<area>/.istm-context/agents.md) (<one-line description>)`. Never one per subfolder, only where distinct conventions exist.
|
|
42
|
+
|
|
43
|
+
## Portability (any OS, any agent)
|
|
44
|
+
|
|
45
|
+
- Commands: `git` is the only required CLI, same on every OS. Other shell snippets (file counts, `find`, `[ -f ]`) are POSIX reference, not literal scripts; use your agent's cross platform file tools (search/glob, read, write) to list, count, and check existence.
|
|
46
|
+
- Bundled files live in this skill's folder: `agent-prompt.md`, the phase mode files (`modes/*.md`), and the pattern presets (`patterns/*.md`). Resolve the folder to an absolute path. Read the matching phase mode file when routing, then `agent-prompt.md` plus the SELECTED pattern preset at write time. Its ALL_CAPS placeholders (PHASE, AREA, ADDITIONAL_STANDARDS, MONOREPO_OR_NO, INSTALLED_SKILLS, DECLINED_TOOLS, and so on) are the inputs you gathered in pre-flight and the question rounds; apply each as you read.
|
|
47
|
+
- No interactive question support? Ask any multiple choice question as plain text with the same options.
|
|
48
|
+
|
|
49
|
+
## Execution
|
|
50
|
+
|
|
51
|
+
The main thread does the writing itself in every phase; it never hands the `.istm-context/agents.md` writing to a subagent. The only subagent this skill spawns reads the codebase, and only when the scan is large: a read only `scout` on the cheapest model (Claude Code: `haiku`, never inheriting the session model) that returns a compact map, from which the main thread writes. A small greenfield scaffold or a single area needs no scout; the main thread reads it directly. Right before writing, the main thread reads `agent-prompt.md` (its persona, per phase instructions, and the `.istm-context/agents.md` templates) plus, in Phase 1, the one selected pattern preset file; it then writes following that guide. Read `agent-prompt.md` only at write time, not during `pre-flight`.
|
|
52
|
+
|
|
53
|
+
### `Pre-flight` (main thread does this before anything else)
|
|
54
|
+
|
|
55
|
+
Gather several signals (a file count alone misleads: a scaffold inflates it, an unfamiliar language zeroes it):
|
|
56
|
+
|
|
57
|
+
1. Context files: root .istm-context/agents.md present → `ROOT_EXISTS`; a CLAUDE.md with content only → `ROOT_LEGACY`; neither → `ROOT_MISSING`.
|
|
58
|
+
2. Source count across common ecosystems (extensions like `.ts/.tsx/.js/.jsx/.py/.go/.rs/.java/.rb/.swift/.kt/.php/.cs/.dart/.ex/.exs/.scala/.c/.cpp/.h/.lua/.clj`), excluding vendored/generated dirs (`node_modules`, `.git`, `dist`, `build`) and config files (`*.config.*`).
|
|
59
|
+
3. Established signals: `git log --oneline` for commit history depth; a real manifest (`package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `composer.json`, `*.csproj`, `pubspec.yaml`, `mix.exs`, `Gemfile`).
|
|
60
|
+
4. Monorepo signal: workspace markers (`pnpm-workspace.yaml`, `turbo.json`, a `"workspaces"` field in `package.json`) or any `apps/*/package.json` / `packages/*/package.json` near the root.
|
|
61
|
+
5. **Workflow setup signal (`WORKFLOW_SETUP`)**: root .istm-context/agents.md is MISSING while the workflow has already decided the stack, i.e. a `.istm-context/specs/` architecture spec exists (a file with a `## Proposed stack` section), and/or `.istm-context/scope/` has a "Stack and architecture" (or similar foundational scaffold) feature. This is the intended greenfield order (`/scope` → `/architect` decides the stack → `/develop` scaffolds it → `/audit`): the project is freshly scaffolded from its chosen stack and still needs its coding standards captured. When this signal fires, the manifest and scaffold source that now exist are the scaffold, not a codebase that already existed.
|
|
62
|
+
|
|
63
|
+
Pick the phase. The order of checks matters: the workflow setup signal outranks the raw code count, because a fresh scaffold has a manifest and source files yet is still greenfield.
|
|
64
|
+
|
|
65
|
+
| Condition | Phase |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Area path given as argument | Phase 3 |
|
|
68
|
+
| `ROOT_EXISTS` (or `ROOT_LEGACY` after migration) | Phase 4 |
|
|
69
|
+
| `ROOT_MISSING` and `WORKFLOW_SETUP` (stack spec and/or scope stack feature) | **Phase 1**, even though a manifest and scaffold source now exist. Ask the coding standards; seed root from the spec's stack. Never treat a just scaffolded workflow project as brownfield. |
|
|
70
|
+
| `ROOT_MISSING`, no `WORKFLOW_SETUP`, no source files AND no manifest | Phase 1 |
|
|
71
|
+
| `ROOT_MISSING`, no `WORKFLOW_SETUP`, has code (source ≥ 10 or a manifest), ≥ 2 commits and clearly real feature code (not just scaffold) | Phase 2, any language |
|
|
72
|
+
| `ROOT_MISSING`, no `WORKFLOW_SETUP`, has code but it looks like untouched scaffold, or ≤ 1 commit, or you can't tell greenfield from brownfield | Phase 0, ask |
|
|
73
|
+
|
|
74
|
+
Why this order: the workflow scaffolds a greenfield project (manifest + starter files) BEFORE `/audit` runs, so a raw code count alone would wrongly read a fresh scaffold as an existing codebase and skip the coding standards questions. The workflow setup signal (a stack spec with no root .istm-context/agents.md) catches exactly that case and routes it to greenfield. Only when there is real feature code, real history, and no in-progress workflow setup is it truly brownfield (Phase 2). Anything ambiguous falls to Phase 0 and asks; never default a maybe greenfield project to brownfield.
|
|
75
|
+
|
|
76
|
+
Monorepo (`MONOREPO=yes`): root plus a light stub per workspace, deepen on demand. Each workspace (`apps/*`, `packages/*`) is a first class area; its primary doc lives at the workspace root (`packages/api/.istm-context/agents.md`), never buried deeper. A whole-repo run does not deep scan every workspace (too expensive, premature); write the repo root `.istm-context/agents.md` (monorepo wide tooling, shared conventions) plus a light stub `.istm-context/agents.md` per workspace from its manifest, no code scan, with root pointers. The full conventions/gotchas/key files scan happens when the engineer runs `/audit packages/api` (Phase 3) or first builds there, never all upfront. A spot inside a workspace that warrants its own doc (`packages/ui/src/mdx/`) gets one in addition to the workspace root doc, linked from it. A doc already there, buried in a workspace with no workspace root doc: ask: "`packages/ui` has a context file at `src/mdx/` but none at its root. Move it up to `packages/ui/.istm-context/agents.md`, or keep it as a nested doc under a new `packages/ui/.istm-context/agents.md`?" On move: relocate it to the workspace root. On keep nested: create the workspace root `.istm-context/agents.md` AND keep the deep one, linking it from the root doc. Migrate legacy `CLAUDE.md` content per the convention above. Apply `MONOREPO=yes` plus the workspace list as you write.
|
|
77
|
+
|
|
78
|
+
Legacy migration (any phase): on `ROOT_LEGACY`, before proceeding ask permission: "I found a `CLAUDE.md` with project context but no `.istm-context/agents.md`. I'll move its content into a new `.istm-context/agents.md` (so all tools read it) and replace `CLAUDE.md` with a pointer. Proceed?" On yes: copy the content verbatim into `.istm-context/agents.md`, then replace `CLAUDE.md` with the pointer; `.istm-context/agents.md` now exists, so continue as Phase 4 (gap-fill). On no: leave both untouched and continue without migrating. Same for any nested `<area>/CLAUDE.md`.
|
|
79
|
+
|
|
80
|
+
### Route to the selected phase
|
|
81
|
+
|
|
82
|
+
Phase 0 (ambiguous) is handled inline below. For Phases 1 to 4, read only the matching mode file, then follow it:
|
|
83
|
+
|
|
84
|
+
- Phase 1 (greenfield setup) → `modes/greenfield.md`
|
|
85
|
+
- Phase 2 (whole-repo scan) → `modes/whole-repo.md`
|
|
86
|
+
- Phase 3 (area scan) → `modes/area.md`
|
|
87
|
+
- Phase 4 (gap-fill) → `modes/gapfill.md`
|
|
88
|
+
|
|
89
|
+
Do not read the other mode files. The greenfield and whole-repo modes additionally read `modes/tool-skills.md` for the Agent Skills / MCP sweep (skip it for area and gap-fill runs).
|
|
90
|
+
|
|
91
|
+
### Phase 0: Classify (only when `pre-flight` is ambiguous)
|
|
92
|
+
|
|
93
|
+
Don't guess. Ask once via your agent's interactive option picker (`AskUserQuestion` on Claude Code), or plain text with the same options. Mark one option `(recommended)` by whichever signal is stronger (a scaffold like tree with a manifest but little history leans New; real feature code and deep history leans Existing), and the picker adds a free text custom slot last:
|
|
94
|
+
- question: "I can't tell if this is a new project or an existing codebase (<state why: e.g. 'a manifest exists but I see no source in a language I recognise', or 'files look like untouched scaffolding'>). Which is it?"
|
|
95
|
+
- header: "Project state"
|
|
96
|
+
- options: 1. `New project`, "I'll ask for your coding standards and seed the context." → Phase 1 (read the manifest/scaffold for the stack; still ask standards). 2. `Existing codebase`, "I'll scan what's here and document it." → Phase 2.
|
|
97
|
+
|
|
98
|
+
### After all phases
|
|
99
|
+
|
|
100
|
+
If no `.istm-context/agents.md` was written when it should have been (the file is missing/empty), report the failure and do it again; don't relay success it didn't produce. Otherwise relay the report: what was discovered (2 to 4 bullets), what was written (file paths), what was proposed or skipped (if existing files were found).
|
|
101
|
+
|
|
102
|
+
## Pattern presets
|
|
103
|
+
|
|
104
|
+
See `patterns/` for the four coding style presets used in Phase 1 (greenfield mode).
|
|
105
|
+
|
|
106
|
+
## Writing guide
|
|
107
|
+
|
|
108
|
+
See `agent-prompt.md` (the main thread reads it at write time; its per phase instructions and `.istm-context/agents.md` templates).
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
# Audit Writing Guide (main thread)
|
|
2
|
+
|
|
3
|
+
You, the main thread, read and follow this when you write the `.istm-context/agents.md` files. It is written as a brief with ALL_CAPS placeholders; read each placeholder as the matching input you gathered in `pre-flight` and the question rounds (the list in each phase mode file). You do the writing yourself; the only subagent this skill uses is a read only `scout` that reads a large codebase and returns a compact map, on the cheapest model.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are running /audit in **PHASE** mode. Use your Read, Bash, Write, and Edit tools freely.
|
|
8
|
+
|
|
9
|
+
## Canonical context file: .istm-context/agents.md (+ a CLAUDE.md pointer)
|
|
10
|
+
|
|
11
|
+
Durable context goes in `.istm-context/agents.md` (root or `<area>/.istm-context/agents.md`), tool agnostic, read by every agent. For each `.istm-context/agents.md` you create, create a sibling `CLAUDE.md` importing it via Claude Code's `@` directive (Claude reads CLAUDE.md and loads .istm-context/agents.md automatically; other tools read .istm-context/agents.md directly). `@.istm-context/agents.md` resolves relative to the CLAUDE.md, so a nested CLAUDE.md imports its sibling nested .istm-context/agents.md:
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
# CLAUDE.md
|
|
15
|
+
|
|
16
|
+
This project's context for all AI tools lives in [.istm-context/agents.md](./.istm-context/agents.md).
|
|
17
|
+
Claude Code loads it via the import below:
|
|
18
|
+
|
|
19
|
+
@.istm-context/agents.md
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Hard rules:
|
|
23
|
+
- Never overwrite an existing `.istm-context/agents.md` (possibly authored by the user or another tool). Create only when missing; otherwise propose additions via the diff format.
|
|
24
|
+
- `CLAUDE.md` only ever holds the pointer; never duplicate .istm-context/agents.md content into it.
|
|
25
|
+
- Migration (when told `MIGRATE=yes`): copy the legacy `CLAUDE.md` content verbatim into a new `.istm-context/agents.md`, then replace `CLAUDE.md` with the pointer above. Never discard curated content.
|
|
26
|
+
- A `CLAUDE.md` pointer that already points to .istm-context/agents.md stays untouched.
|
|
27
|
+
|
|
28
|
+
## Stamp what you write, so curated content is knowable
|
|
29
|
+
|
|
30
|
+
Every `.istm-context/agents.md` this skill creates ends with the drafted by line in the templates below. It exists so a later run (this skill or `/sync`) can tell what a tool wrote from what a human wrote, instead of guessing.
|
|
31
|
+
|
|
32
|
+
- **Creating a file**: end it with the drafted by line, exactly as the template shows.
|
|
33
|
+
- **Gap filling a file that still carries the line**: the untouched parts are yours to correct; add or fix facts surgically, and leave the line in place.
|
|
34
|
+
- **Gap filling a file with no drafted by line**: a human has taken it over. Add missing facts only, never rewrite an existing line, and route anything that would change existing prose to CONTRADICTIONS.
|
|
35
|
+
|
|
36
|
+
The stamp records provenance, not permission. It never licenses overwriting a line someone edited, and the "never overwrite curated prose" rule in the contract below holds either way.
|
|
37
|
+
|
|
38
|
+
## The mirrored root fields
|
|
39
|
+
|
|
40
|
+
<!-- ROOT-FIELD-CONTRACT:START (identical in /audit and /sync; edit both or neither) -->
|
|
41
|
+
Root `.istm-context/agents.md` carries two mirrored fields. Each has exactly one source of truth outside the file, and no skill may invent a value for either:
|
|
42
|
+
|
|
43
|
+
- `## Stack` mirrors the architecture spec, the one under `.istm-context/specs/` with a `## Proposed stack` section.
|
|
44
|
+
- `## Build approach` mirrors the scope header's build approach line, the one `/scope` records.
|
|
45
|
+
|
|
46
|
+
Three rules bind every skill that touches them. Never overwrite curated prose in either field. Fill a field only when it is missing or still a placeholder. When a field and its source disagree, flag the divergence and name the file you read the source from, rather than picking a winner.
|
|
47
|
+
<!-- ROOT-FIELD-CONTRACT:END -->
|
|
48
|
+
|
|
49
|
+
What `/audit` does with them (every phase that writes or audits root):
|
|
50
|
+
|
|
51
|
+
- **Creating root** (greenfield, whole-repo): populate `## Stack` from the architecture spec if it exists (the source of truth, even on greenfield with no code); else derive from the code/manifest, else `<to be filled>`. Seed `## Build approach` from the scope header if one exists, a short line: name + one line principle; if no scope, or none set, write `<TBD, set by /scope>` rather than guessing.
|
|
52
|
+
- **`## Git`** (from the git integration question): write the engineer's choice as a small block the other skills read, e.g. `- integration: on` / `- branch prefix: feat/` / `- commit: per-milestone`, or just `- integration: off`. Absent means off. It is a recorded preference, not a mirrored source of truth like Stack/Build approach; `/develop` reads it to branch and commit, `/document` to gate the PR.
|
|
53
|
+
- **Auditing existing root** (gap-fill): either field missing or placeholder → ROOT_GAPS; either field contradicting its source → CONTRADICTIONS.
|
|
54
|
+
|
|
55
|
+
This keeps the `/architect → /audit` handoff order-independent: root absorbs the decided stack whenever audit runs.
|
|
56
|
+
|
|
57
|
+
## Phase
|
|
58
|
+
|
|
59
|
+
PHASE
|
|
60
|
+
<!-- one of: greenfield | whole-repo | area | gap-fill -->
|
|
61
|
+
|
|
62
|
+
## Scope / area
|
|
63
|
+
|
|
64
|
+
SCOPE_OR_AREA
|
|
65
|
+
<!-- "whole repo" or a specific path like "src/auth" -->
|
|
66
|
+
|
|
67
|
+
## Monorepo
|
|
68
|
+
|
|
69
|
+
MONOREPO_OR_NO
|
|
70
|
+
<!-- "no", or "yes, apps: web, api, …". If yes: each app/package is its own area, give each
|
|
71
|
+
a nested .istm-context/agents.md with its own stack/commands/conventions; root .istm-context/agents.md keeps
|
|
72
|
+
monorepo-wide concerns (workspace tooling, shared conventions) only. -->
|
|
73
|
+
|
|
74
|
+
## Task context
|
|
75
|
+
|
|
76
|
+
TASK_CONTEXT_OR_NONE
|
|
77
|
+
|
|
78
|
+
## Existing root .istm-context/agents.md
|
|
79
|
+
|
|
80
|
+
ROOT_AGENTS_MD_CONTENTS_OR_MISSING
|
|
81
|
+
<!-- contents, or a file path for you to Read, or "MISSING" -->
|
|
82
|
+
|
|
83
|
+
## Existing area .istm-context/agents.md
|
|
84
|
+
|
|
85
|
+
AREA_AGENTS_MD_CONTENTS_OR_MISSING
|
|
86
|
+
<!-- contents or a file path to Read; "MISSING" if phase is not area, or file doesn't exist -->
|
|
87
|
+
|
|
88
|
+
## Selected coding patterns (Phase 1 only)
|
|
89
|
+
|
|
90
|
+
SELECTED_PATTERNS_OR_NONE
|
|
91
|
+
<!-- Contents or file path(s) of the chosen pattern preset(s), or the engineer's exact "Other" text -->
|
|
92
|
+
|
|
93
|
+
## Additional standards selected (Phase 1 only)
|
|
94
|
+
|
|
95
|
+
ADDITIONAL_STANDARDS_OR_NONE
|
|
96
|
+
<!-- e.g. "Strict types, Conventional commits" -->
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Instructions by phase
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### GREENFIELD phase
|
|
105
|
+
|
|
106
|
+
New project, possibly just scaffolded from its chosen stack (there may be a manifest and scaffold source, but no real feature code yet, and usually an architecture spec that decided the stack). Create a root .istm-context/agents.md encoding the engineer's chosen standards.
|
|
107
|
+
|
|
108
|
+
**Step 1: Minimal discovery**
|
|
109
|
+
|
|
110
|
+
With your file tools, list the top couple of project levels (excluding `.git`); read the manifest if present (note language, package manager). Check `.istm-context/specs/` for numbered specs (`NNNN-*.md`); if an architecture spec exists (`## Proposed stack` section), read it: the stack is already decided via `/architect`, use it for `## Stack`, no placeholders, never contradict it. Check `.istm-context/scope/` (or `.workflow/scope/`): if the scope header records a build approach (name + one line principle), capture it verbatim as the `## Build approach` seed; else `<TBD, set by /scope>`.
|
|
111
|
+
|
|
112
|
+
**Step 2: Create root .istm-context/agents.md**
|
|
113
|
+
|
|
114
|
+
Use the template below. `## Stack`: spec, else findings, else `<to be filled>`. `## Build approach`: scope header, else `<TBD, set by /scope>`. `## Rules`: base on SELECTED_PATTERNS (Read it if given as a path); if "Other" free text was chosen, include it verbatim, never interpret or reformat it; append ADDITIONAL_STANDARDS as extra bullets at the end.
|
|
115
|
+
|
|
116
|
+
If `INSTALLED_SKILLS_OR_NONE` is provided, write a `## Agent skills` section (template above): ONE bullet per installed skill, `- [<skill>](<skills-dir>/<skill>/): `<owner>/<repo>`, <what it covers>`, so a later skill loads only the ones a task needs, never a single dense line of names. Detect the project's real skills directory (`.claude/skills/` on Claude Code, `.agents/skills/` on other agents, or a plain `skills/`) and use it in the link; never hardcode a Claude only path, since every tool reads this file. Keep the registry source `<owner>/<repo>` on each bullet as the tool agnostic identity a different agent resolves in its own dir. If `DECLINED_TOOLS_OR_NONE` is provided, add a compact `Declined: <tool>, <tool>` line in that section (a decline has nothing to load, so it needs no location; it stops a later `/audit` or `/architect` offering it again). If `MCP_SERVERS_OR_NONE`, add a compact `MCP servers: <server> (connected|recommended)` line (a connected service has no local file to open). Project wide tech at root; area specific at that area's nested doc, using the same `## Agent skills` section.
|
|
117
|
+
|
|
118
|
+
Monorepo: keep root to monorepo wide concerns (workspace tooling `pnpm`/`turbo`/`nx`, shared standards, a `## Context files` section pointing at each workspace's nested doc); per app stack does not go in root.
|
|
119
|
+
|
|
120
|
+
**Step 2b: Per workspace nested .istm-context/agents.md (monorepo only)**
|
|
121
|
+
|
|
122
|
+
If `MONOREPO_OR_NO` is `yes`: for each listed workspace (`apps/*`, `packages/*`), read its manifest. Even with no features built, the scaffold declares the workspace's stack and commands; capture them so `/architect` and `/develop` read them from the workspace's own doc (they won't look in root). Write `<workspace>/.istm-context/agents.md` with the nested template (`## Stack` from its manifest, `## Commands` from its scripts, scoped, e.g. `pnpm --filter <name> dev`, root `## Rules` inherited by reference), plus the sibling `<workspace>/CLAUDE.md` pointer and a pointer line under root's `## Context files`. Skip an empty placeholder workspace with no manifest.
|
|
123
|
+
|
|
124
|
+
**Step 3: Report** (format at the bottom); list every per workspace doc created.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### WHOLE-REPO phase
|
|
129
|
+
|
|
130
|
+
A codebase exists but no .istm-context/agents.md. Explore enough to write an accurate root .istm-context/agents.md.
|
|
131
|
+
|
|
132
|
+
**Step 1: Discover**
|
|
133
|
+
|
|
134
|
+
With your file tools, list the project tree a few levels deep, skipping vendored/generated dirs (`.git`, `node_modules`, `.next`, `dist`, `build`). Read whichever exist:
|
|
135
|
+
- `package.json` / `pyproject.toml` / `Cargo.toml` / `go.mod`: stack and deps
|
|
136
|
+
- `.github/workflows/`: CI and deploy patterns
|
|
137
|
+
- Main entry point (`src/index.*`, `main.*`, `app.*`, `server.*`)
|
|
138
|
+
- Test config (`jest.config.*`, `pytest.ini`, `vitest.config.*`)
|
|
139
|
+
- All existing `.istm-context/agents.md` (excluding `.git`); for each nested one found (not the root), add a pointer line under `## Context files` when writing root: `- [<path>](<path>): <one-line description inferred from the file's ## Overview section>`.
|
|
140
|
+
|
|
141
|
+
**Step 2: Extract durable knowledge**
|
|
142
|
+
|
|
143
|
+
Stack, runtime, framework; daily commands (install, dev, build, test); conventions visible in the code (naming, file structure, patterns); what would trip up a new developer in week one. Discard implementation details, TODO comments, anything that changes frequently.
|
|
144
|
+
|
|
145
|
+
**Step 3: Create root .istm-context/agents.md** with the template below; global and short (≤60 lines), area detail goes in nested docs (next step).
|
|
146
|
+
|
|
147
|
+
**Step 4: Create nested .istm-context/agents.md**
|
|
148
|
+
|
|
149
|
+
Monorepo (`MONOREPO_OR_NO` = yes): don't judge or deep scan. Every workspace (`apps/*`, `packages/*`) gets a light stub `.istm-context/agents.md` at its root (`## Stack` + `## Commands` from its manifest, scoped, e.g. `pnpm -F <name> …`, plus a one line overview), the sibling `CLAUDE.md` pointer, and a root `## Context files` pointer. No code scan; deep conventions come later via `/audit <workspace>`. A doc buried below a workspace root (e.g. `packages/ui/src/mdx/`) with no root doc: follow the relocation rule the main agent surfaced (move up, or root doc + linked nested). Skip the judgment step below.
|
|
150
|
+
|
|
151
|
+
Single repo: identify the major areas/modules (e.g. `src/auth`, `src/payments`, `src/api`, `src/jobs`); judge each. Warrants a nested doc: distinct conventions, not obvious rules, local commands, external integrations, or gotchas a developer must know before touching it. Does not: a simple module with no surprises, or root already covers it (skip; never one per folder). For each warranted area: write `<area>/.istm-context/agents.md` with the nested template, its sibling `<area>/CLAUDE.md` pointer, and one pointer line in root's `## Context files` via Edit:
|
|
152
|
+
```
|
|
153
|
+
- [<area>/.istm-context/agents.md](<area>/.istm-context/agents.md): <one-line description>
|
|
154
|
+
```
|
|
155
|
+
Global facts in root; area knowledge kept alongside the area's code (it loads automatically when that code is edited).
|
|
156
|
+
|
|
157
|
+
**Step 5: Report** (format at the bottom); list every nested doc created.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
### AREA phase
|
|
162
|
+
|
|
163
|
+
Root .istm-context/agents.md exists. Job: (1) check whether root .istm-context/agents.md has what this area needs, (2) create or update the nested .istm-context/agents.md.
|
|
164
|
+
|
|
165
|
+
**Step 1: Explore the area**
|
|
166
|
+
|
|
167
|
+
With your file tools, list all files under `SCOPE_OR_AREA`. Read: key source files (entry points, main modules, not every file, use judgement); test files in this area; any local config (tsconfig, .env.example, etc.); the existing root and area .istm-context/agents.md (provided above; Read them if given as paths).
|
|
168
|
+
|
|
169
|
+
**Step 2: Gap check root .istm-context/agents.md**
|
|
170
|
+
|
|
171
|
+
Flag a gap only if it is: a command engineers working in this area need but root doesn't mention; a stack element, runtime, or major dependency relevant to this area but absent from root; a hard project wide rule the area makes visible (e.g. "all DB calls go through the repository layer"). Do NOT flag area specific file lists, local conventions, or anything that belongs in a nested file.
|
|
172
|
+
|
|
173
|
+
Collect gaps in this format for the final report under `Root gaps flagged`:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
ROOT_GAPS:
|
|
177
|
+
- <exact markdown line to add>, target section: `## <section>`, reason: <one line>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
If no gaps: `ROOT_GAPS: none`. Keep the exact text to insert so you can apply it with Edit without paraphrasing.
|
|
181
|
+
|
|
182
|
+
**Step 3: Nested .istm-context/agents.md**
|
|
183
|
+
|
|
184
|
+
Warrant (own patterns, not obvious rules, local commands, or constraints a developer needs to know first) vs not (a simple CRUD module with no surprises, or already well covered by root .istm-context/agents.md).
|
|
185
|
+
|
|
186
|
+
- Missing + warranted → create with the nested template, then add a pointer to root .istm-context/agents.md (all root modifications via Edit): `## Context files` holding only a placeholder comment (`<!-- ... -->`) → replace the comment line with the pointer; existing entries → append the pointer line; section absent → add the section and pointer before `## specs` (or at the end if no specs section).
|
|
187
|
+
- Missing + not warranted → note why in the report and skip.
|
|
188
|
+
- Exists → propose additions only (never overwrite), via the diff format below.
|
|
189
|
+
|
|
190
|
+
**Step 4: Report** (format at the bottom).
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### GAP-FILL phase
|
|
195
|
+
|
|
196
|
+
Root .istm-context/agents.md already exists; the codebase is partially documented. Audit the whole codebase against the existing docs and fill only what's genuinely missing; never rewrite curated content.
|
|
197
|
+
|
|
198
|
+
**Step 1: Read what's documented**
|
|
199
|
+
|
|
200
|
+
Read the existing root .istm-context/agents.md (provided above; Read it if given as a path) and every nested .istm-context/agents.md (paths provided above).
|
|
201
|
+
|
|
202
|
+
**Step 2: Scan the codebase**
|
|
203
|
+
|
|
204
|
+
With your file tools, list the project tree a few levels deep, skipping vendored/generated dirs (`.git`, `node_modules`, `.next`, `dist`, `build`). Read the manifest(s), CI config, entry points, and a sample of each major area; build a picture of the real stack, commands, conventions, and major areas.
|
|
205
|
+
|
|
206
|
+
**Step 3: Find four kinds of finding**
|
|
207
|
+
|
|
208
|
+
- (a) Global facts missing from root: a daily command, stack element, project wide rule, or the build approach (in the scope header but absent from root) that's true but not recorded. Collect each as a `ROOT_GAPS` line (exact markdown + target section) and apply it only with the engineer's permission (the gap handling step in `modes/gapfill.md`), never silently, since a root line may be curated.
|
|
209
|
+
- (b) Undocumented areas: a major area with distinct conventions/gotchas and no nested .istm-context/agents.md. Create the nested doc (nested template + sibling CLAUDE.md pointer) and add its root pointer line via Edit (safe to do directly: creating, not overwriting).
|
|
210
|
+
- (c) Stale/incomplete nested docs: an existing nested .istm-context/agents.md missing something now true of its area. Return as `PROPOSED_ADDITIONS`; do NOT edit it yourself.
|
|
211
|
+
- (d) Contradictions: a doc states something the codebase or its governing records disprove (documented test runner or framework isn't the one actually used; `## Stack` conflicts with the architecture spec; `## Build approach` differs from the scope header; a documented command no longer exists). Worse than a gap, the docs are actively wrong; do NOT fix it automatically (the line may be curated). Collect each as a `CONTRADICTIONS` entry naming the doc, what it says, and what the code/spec/scope actually shows; surface these to the human, don't fix them automatically.
|
|
212
|
+
|
|
213
|
+
Be conservative: flag only durable findings you're confident about; when unsure, leave it. Do not flag implementation detail, TODOs, or anything that churns.
|
|
214
|
+
|
|
215
|
+
**Step 4: Report** (format at the bottom). Put (a) under `Root gaps flagged`, (c) under `Proposed`, (d) under `Contradictions`, and list (b), the nested docs you created, under `Written`.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Root .istm-context/agents.md template
|
|
220
|
+
|
|
221
|
+
=== ROOT .istm-context/agents.md TEMPLATE START ===
|
|
222
|
+
# <Project name>
|
|
223
|
+
|
|
224
|
+
## Stack
|
|
225
|
+
|
|
226
|
+
- **Language / Runtime**: <e.g. TypeScript, Node 20>
|
|
227
|
+
- **Framework**: <e.g. Next.js 14, Express>
|
|
228
|
+
- **Key dependencies**: <3 to 5 most important>
|
|
229
|
+
- **Package manager**: <npm / pnpm / yarn / pip / cargo>
|
|
230
|
+
|
|
231
|
+
## Build approach
|
|
232
|
+
|
|
233
|
+
<The project's default build strategy, a short line: name + one line principle. A project wide
|
|
234
|
+
convention every skill reads (like the stack). Seeded from the scope header; `<TBD, set by
|
|
235
|
+
/scope>` if none is set yet. The approach is one of:
|
|
236
|
+
- **Tracer Bullet**, vertical end to end slices, thin but complete through every layer
|
|
237
|
+
- **Skateboard**, ship the thinnest usable whole, then grow it
|
|
238
|
+
- **Facade**, UI first shell, then wire the real behavior behind it (prototype led)
|
|
239
|
+
- **Journey**, build the full user path, one phase at a time>
|
|
240
|
+
|
|
241
|
+
## Commands
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Install
|
|
245
|
+
<command>
|
|
246
|
+
|
|
247
|
+
# Dev server
|
|
248
|
+
<command>
|
|
249
|
+
|
|
250
|
+
# Build
|
|
251
|
+
<command>
|
|
252
|
+
|
|
253
|
+
# Test
|
|
254
|
+
<command>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Specs
|
|
258
|
+
|
|
259
|
+
Stored in `.istm-context/specs/`. Format: `.istm-context/specs/NNNN-title.md`.
|
|
260
|
+
|
|
261
|
+
## Rules
|
|
262
|
+
|
|
263
|
+
<Conventions that apply everywhere, from pattern presets and/or discovered from code.
|
|
264
|
+
For greenfield: paste the selected pattern conventions here.
|
|
265
|
+
For whole-repo: extract what you observe in the code.
|
|
266
|
+
Keep this to 5 to 10 bullet points max.>
|
|
267
|
+
|
|
268
|
+
## Agent skills
|
|
269
|
+
|
|
270
|
+
<Installed Agent Skills that carry this project's tool conventions. ONE bullet per skill so a
|
|
271
|
+
later skill (/architect, /develop) opens only the ones a task needs, never a single dense line
|
|
272
|
+
of names, and omit the whole section if none installed. Each bullet: the skill name, its
|
|
273
|
+
registry source `<owner>/<repo>` (the stable, tool agnostic identity), a one line note on what
|
|
274
|
+
it governs, and a link to where it lives IN THIS PROJECT. The skills directory is agent specific:
|
|
275
|
+
detect the real one this project uses (`.claude/skills/` for Claude Code, `.agents/skills/` for
|
|
276
|
+
other agents, or a plain `skills/`) and use that, never hardcode a Claude only path, since every
|
|
277
|
+
tool reads this file and resolves the source in its own skills dir. Only project wide skills go
|
|
278
|
+
here; an area specific skill goes in that area's nested .istm-context/agents.md.>
|
|
279
|
+
- [<skill>](<skills-dir>/<skill>/): `<owner>/<repo>`, <one line: what it governs>
|
|
280
|
+
|
|
281
|
+
<Then, only if present, a compact line each (a declined tool has nothing to load, and an MCP
|
|
282
|
+
server is a connected service with no local file, so both stay lines, not bullets):
|
|
283
|
+
`Declined: <tool>, <tool>` (offered before, not wanted; keep so a later /audit or /architect
|
|
284
|
+
does not offer it again) · `MCP servers: <server> (connected), <server> (recommended)`>
|
|
285
|
+
|
|
286
|
+
## Context files
|
|
287
|
+
|
|
288
|
+
<!-- Nested .istm-context/agents.md files are listed here as they are created -->
|
|
289
|
+
|
|
290
|
+
_Drafted by /audit from the repo, worth a quick human pass. Edit freely: once a line stops matching this draft, later runs treat it as curated and will flag rather than overwrite it._
|
|
291
|
+
|
|
292
|
+
=== ROOT .istm-context/agents.md TEMPLATE END ===
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Nested .istm-context/agents.md template
|
|
297
|
+
|
|
298
|
+
```markdown
|
|
299
|
+
# <Area name>
|
|
300
|
+
|
|
301
|
+
## Overview
|
|
302
|
+
|
|
303
|
+
<2 to 3 sentences: what this area does and why it exists>
|
|
304
|
+
|
|
305
|
+
## Key files
|
|
306
|
+
|
|
307
|
+
| File | Owns |
|
|
308
|
+
|---|---|
|
|
309
|
+
| <path> | <what it does, one line> |
|
|
310
|
+
|
|
311
|
+
## Commands
|
|
312
|
+
|
|
313
|
+
<Local commands if different from root, omit section if identical>
|
|
314
|
+
|
|
315
|
+
## Conventions
|
|
316
|
+
|
|
317
|
+
<Bullet list of area-specific conventions, constraints, and non-obvious rules>
|
|
318
|
+
|
|
319
|
+
## Gotchas
|
|
320
|
+
|
|
321
|
+
<Non-obvious invariants that would trip a developer, omit section if none>
|
|
322
|
+
|
|
323
|
+
## Agent skills
|
|
324
|
+
|
|
325
|
+
<Area-specific installed skills, same bullet format as root (name, registry source, note, and a
|
|
326
|
+
link to the detected project skills dir, never a hardcoded `.claude/` path), omit section if none:
|
|
327
|
+
- [<skill>](<skills-dir>/<skill>/): `<owner>/<repo>`, <what it governs for this area>
|
|
328
|
+
A declined tool or MCP server stays a compact `Declined:` / `MCP servers:` line, as in root.>
|
|
329
|
+
|
|
330
|
+
## Related specs
|
|
331
|
+
|
|
332
|
+
<Links once specs exist, omit section if none yet>
|
|
333
|
+
|
|
334
|
+
_Drafted by /audit from the repo, worth a quick human pass. Edit freely: once a line stops matching this draft, later runs treat it as curated and will flag rather than overwrite it._
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Proposed diff format (when a file already exists)
|
|
340
|
+
|
|
341
|
+
Do not overwrite. Output this block and stop:
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
PROPOSED_ADDITIONS for <file path>:
|
|
345
|
+
|
|
346
|
+
Under `## <section>`, add:
|
|
347
|
+
|
|
348
|
+
<exact markdown to insert>
|
|
349
|
+
|
|
350
|
+
Reason: <one line>
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Only propose what is absent and genuinely useful. Do not rewrite existing content.
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Report format (end of every phase)
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
## /audit complete
|
|
361
|
+
|
|
362
|
+
**Phase**: <greenfield | whole-repo | area | gap-fill>
|
|
363
|
+
**Scope**: <what was explored>
|
|
364
|
+
|
|
365
|
+
**Discovered**:
|
|
366
|
+
- <finding>
|
|
367
|
+
- <finding>
|
|
368
|
+
|
|
369
|
+
**Written**:
|
|
370
|
+
- <file path> (<created | pointer added | updated>)
|
|
371
|
+
|
|
372
|
+
**Root gaps flagged** (area / gap-fill phases):
|
|
373
|
+
<ROOT_GAPS output or "none">
|
|
374
|
+
|
|
375
|
+
**Proposed** (existing files):
|
|
376
|
+
<PROPOSED_ADDITIONS block or "none">
|
|
377
|
+
|
|
378
|
+
**Contradictions** (gap-fill phase, docs the code disproves; for a human to resolve):
|
|
379
|
+
<CONTRADICTIONS entries or "none">
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Rules you must not break
|
|
385
|
+
|
|
386
|
+
- Write the `.istm-context/agents.md` files with your file tools; don't paste their full contents back into the chat. When the phase is done, produce the report block at the end as your working summary for the relay.
|
|
387
|
+
- ROOT_GAPS goes under `Root gaps flagged` in that summary. Keep the exact markdown text to insert so you apply it (with the engineer's permission) without paraphrasing.
|
|
388
|
+
- Do not create a nested .istm-context/agents.md unless the area genuinely warrants it.
|
|
389
|
+
- Root .istm-context/agents.md must stay under ~60 lines. Cut ruthlessly.
|
|
390
|
+
- Never overwrite an existing .istm-context/agents.md, propose additions only via the diff format.
|
|
391
|
+
- Do not create specs. Do not write plans. Stay in your lane.
|
|
392
|
+
- Proposed additions must be additions only, no rewrites of existing sections.
|
|
393
|
+
- When the engineer selected "Other" for architecture style, use their free text verbatim in `## Rules`. Do not interpret or paraphrase it.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# OpenAI Codex adapter. This file supplies the interface metadata Codex shows in
|
|
2
|
+
# its agent picker. The skill's actual instructions live in ../SKILL.md, which the
|
|
3
|
+
# Agent Skills client installs alongside this file and loads when the skill runs.
|
|
4
|
+
interface:
|
|
5
|
+
display_name: "Audit"
|
|
6
|
+
short_description: "Bootstrap project AI context files"
|
|
7
|
+
default_prompt: "Run the audit skill: read its SKILL.md, then create or refresh the AGENTS.md context files for this project."
|